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

@@ -25,43 +25,38 @@ public class ChoosePreferenceController extends SimpleFormController {
/** Logger for this class and subclasses */ /** Logger for this class and subclasses */
protected final Log logger = LogFactory.getLog(getClass()); protected final Log logger = LogFactory.getLog(getClass());
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 b=new Article(2,"php in action","php discussion","","",null,1);
articleList.add(a); Article a=new Article(1,"j2ee in action","j2ee discussion","","",null,1);
articleList.add(b); Article b=new Article(2,"php in action","php discussion","","",null,1);
} articleList.add(a);
arg0.getSession().setAttribute("articleList", articleList); articleList.add(b);
return new ModelAndView("choosePreference"); getServletContext().setAttribute("articleList", articleList);
// TODO Auto-generated method stub
return super.formBackingObject(request);
} }
@Override @Override
protected ModelAndView onSubmit(HttpServletRequest request, protected ModelAndView onSubmit(HttpServletRequest request,
HttpServletResponse response, Object command, BindException errors) HttpServletResponse response, Object command, BindException errors)
throws Exception { throws Exception {
FormPreference fp=(FormPreference) command; FormPreference fp=(FormPreference) command;
List<Preference> listPreference=fp.getPreferences(); List<Preference> listPreference=fp.getPreferences();
// to do with the part of core using preferenceManager // to do with the part of core using preferenceManager
return new ModelAndView("choosePreferenceOK"); return new ModelAndView("choosePreferenceOK");
} }
@@ -74,6 +69,6 @@ public class ChoosePreferenceController extends SimpleFormController {
public void setArticleManager(IArticleManager articleManager) { public void setArticleManager(IArticleManager articleManager) {
this.articleManager = articleManager; this.articleManager = articleManager;
} }
} }

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;
} }