Policy failures:

Code warning
- failed on resource ChoosePreferenceController.java. Reason: The import javax.servlet.ServletException is never used, line 8
- failed on resource ChoosePreferenceController.java. Reason: The import org.springframework.web.servlet.view.RedirectView is never used, line 17
- failed on resource ChoosePreferenceController.java. Reason: The local variable listPreference is never read, line 55
- failed on resource SArticleController.java. Reason: The local variable secondaryauthor is never read, line 3
Override reason:   
hihi
This commit is contained in:
Frederic Debuire
2007-12-17 10:07:09 +00:00
parent 8b6611e660
commit 7ee3eb724c
2 changed files with 24 additions and 29 deletions

View File

@@ -27,28 +27,23 @@ public class ChoosePreferenceController extends SimpleFormController {
private IArticleManager articleManager; private IArticleManager articleManager;
@Override @Override
public ModelAndView handleRequest(HttpServletRequest arg0, protected Object formBackingObject(HttpServletRequest request)
HttpServletResponse arg1) throws Exception { throws Exception {
List<Article> articleList=new ArrayList<Article>(); List<Article> articleList=new ArrayList<Article>();
if (articleList==null)
{ Article a=new Article(1,"j2ee in action","j2ee discussion","","",null,1); System.out.println("hihi");
Article a=new Article(1,"j2ee in action","j2ee discussion","","",null,1);
Article b=new Article(2,"php in action","php discussion","","",null,1); Article b=new Article(2,"php in action","php discussion","","",null,1);
articleList.add(a); articleList.add(a);
articleList.add(b); articleList.add(b);
getServletContext().setAttribute("articleList", articleList);
return super.formBackingObject(request);
} }
arg0.getSession().setAttribute("articleList", articleList);
return new ModelAndView("choosePreference");
// TODO Auto-generated method stub
}
@Override @Override
protected ModelAndView onSubmit(HttpServletRequest request, protected ModelAndView onSubmit(HttpServletRequest request,

View File

@@ -60,10 +60,10 @@ public class SArticleController extends SimpleFormController {
protected Object formBackingObject(HttpServletRequest request) throws ServletException { protected Object formBackingObject(HttpServletRequest request) throws ServletException {
FormSubmission myArticle = new FormSubmission(); FormSubmission myArticle = new FormSubmission();
myArticle.setTitle("Article's title"); myArticle.setTitle("");
myArticle.setTheme("Article's theme"); myArticle.setTheme("");
myArticle.setMainauthor("Main author"); myArticle.setMainauthor("");
myArticle.setSecondaryauthor("Secondary authors"); myArticle.setSecondaryauthor("");
return myArticle; return myArticle;
} }