Minor fixes

git-svn-id: http://webgoat.googlecode.com/svn/trunk/webgoat@337 4033779f-a91e-0410-96ef-6bf7bf53c507
This commit is contained in:
wirth.marcel
2008-04-14 12:03:55 +00:00
parent c4b5bb0758
commit 15d80a3006
9 changed files with 57 additions and 35 deletions

View File

@ -1,6 +1,9 @@
package org.owasp.webgoat.lessons.SQLInjection;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.ecs.ElementContainer;
@ -245,4 +248,27 @@ public class SQLInjection extends GoatHillsFinancial
{
return "LAB: SQL Injection";
}
@Override
public String getSolution(WebSession s) {
String src = null;
try
{
src = readFromFile(new BufferedReader(new FileReader(s.getWebResource(getLessonSolutionFileName(s)))), false);
} catch (IOException e)
{
s.setMessage("Could not find the solution file");
src = ("Could not find the solution file");
}
return src;
}
public String getLessonSolutionFileName(WebSession s) {
System.out.println("SOLUTION!!!");
String solutionFileName = null;
String stage = getStage(s);
solutionFileName = "/lesson_solutions/Lab SQL Injection/Lab " + stage + ".html";
return solutionFileName;
}
}