Pass webgoatContext to AbstractLesson, so all lessons can know their environment
git-svn-id: http://webgoat.googlecode.com/svn/trunk@139 4033779f-a91e-0410-96ef-6bf7bf53c507
This commit is contained in:
parent
1849197784
commit
ada66dae10
@ -24,6 +24,7 @@ import org.apache.ecs.html.Title;
|
|||||||
import org.owasp.webgoat.session.ParameterNotFoundException;
|
import org.owasp.webgoat.session.ParameterNotFoundException;
|
||||||
import org.owasp.webgoat.session.Screen;
|
import org.owasp.webgoat.session.Screen;
|
||||||
import org.owasp.webgoat.session.WebSession;
|
import org.owasp.webgoat.session.WebSession;
|
||||||
|
import org.owasp.webgoat.session.WebgoatContext;
|
||||||
import org.owasp.webgoat.session.WebgoatProperties;
|
import org.owasp.webgoat.session.WebgoatProperties;
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
@ -98,6 +99,8 @@ public abstract class AbstractLesson extends Screen implements Comparable
|
|||||||
|
|
||||||
private String lessonPlanFileName;
|
private String lessonPlanFileName;
|
||||||
|
|
||||||
|
private WebgoatContext webgoatContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for the Lesson object
|
* Constructor for the Lesson object
|
||||||
*/
|
*/
|
||||||
@ -849,4 +852,14 @@ public abstract class AbstractLesson extends Screen implements Comparable
|
|||||||
// + sourceFileName);
|
// + sourceFileName);
|
||||||
this.sourceFileName = sourceFileName;
|
this.sourceFileName = sourceFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public WebgoatContext getWebgoatContext() {
|
||||||
|
return webgoatContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setWebgoatContext(WebgoatContext webgoatContext) {
|
||||||
|
this.webgoatContext = webgoatContext;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,7 @@ public class Course
|
|||||||
|
|
||||||
private List<String> files = new LinkedList<String>();
|
private List<String> files = new LinkedList<String>();
|
||||||
|
|
||||||
|
private WebgoatContext webgoatContext;
|
||||||
|
|
||||||
public Course()
|
public Course()
|
||||||
{
|
{
|
||||||
@ -365,6 +366,7 @@ public class Course
|
|||||||
if(o instanceof AbstractLesson)
|
if(o instanceof AbstractLesson)
|
||||||
{
|
{
|
||||||
AbstractLesson lesson = (AbstractLesson)o;
|
AbstractLesson lesson = (AbstractLesson)o;
|
||||||
|
lesson.setWebgoatContext(webgoatContext);
|
||||||
|
|
||||||
lesson.update(properties);
|
lesson.update(properties);
|
||||||
|
|
||||||
@ -423,8 +425,9 @@ public class Course
|
|||||||
* @param path Description of the Parameter
|
* @param path Description of the Parameter
|
||||||
* @param context Description of the Parameter
|
* @param context Description of the Parameter
|
||||||
*/
|
*/
|
||||||
public void loadCourses(boolean enterprise, ServletContext context, String path)
|
public void loadCourses(WebgoatContext webgoatContext, ServletContext context, String path)
|
||||||
{
|
{
|
||||||
|
this.webgoatContext = webgoatContext;
|
||||||
loadFiles(context, path);
|
loadFiles(context, path);
|
||||||
loadLessons(path);
|
loadLessons(path);
|
||||||
loadResources();
|
loadResources();
|
||||||
|
@ -23,7 +23,6 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
|
|
||||||
import org.owasp.webgoat.lessons.AbstractLesson;
|
import org.owasp.webgoat.lessons.AbstractLesson;
|
||||||
import org.owasp.webgoat.lessons.Category;
|
import org.owasp.webgoat.lessons.Category;
|
||||||
import org.owasp.webgoat.lessons.admin.RefreshDBScreen;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
*
|
*
|
||||||
@ -261,7 +260,7 @@ public class WebSession
|
|||||||
servletName = servlet.getServletName();
|
servletName = servlet.getServletName();
|
||||||
this.context = context;
|
this.context = context;
|
||||||
course = new Course();
|
course = new Course();
|
||||||
course.loadCourses( enterprise, context, "/" );
|
course.loadCourses( webgoatContext, context, "/" );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized Connection getConnection(WebSession s)
|
public static synchronized Connection getConnection(WebSession s)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user