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:
@@ -25,43 +25,38 @@ public class ChoosePreferenceController extends SimpleFormController {
|
||||
/** Logger for this class and subclasses */
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private IArticleManager articleManager;
|
||||
|
||||
|
||||
private IArticleManager articleManager;
|
||||
|
||||
@Override
|
||||
public ModelAndView handleRequest(HttpServletRequest arg0,
|
||||
HttpServletResponse arg1) throws Exception {
|
||||
protected Object formBackingObject(HttpServletRequest request)
|
||||
throws Exception {
|
||||
|
||||
List<Article> articleList=new ArrayList<Article>();
|
||||
if (articleList==null)
|
||||
{ Article a=new Article(1,"j2ee in action","j2ee discussion","","",null,1);
|
||||
Article b=new Article(2,"php in action","php discussion","","",null,1);
|
||||
articleList.add(a);
|
||||
articleList.add(b);
|
||||
}
|
||||
arg0.getSession().setAttribute("articleList", articleList);
|
||||
|
||||
return new ModelAndView("choosePreference");
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
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);
|
||||
articleList.add(a);
|
||||
articleList.add(b);
|
||||
|
||||
getServletContext().setAttribute("articleList", articleList);
|
||||
|
||||
return super.formBackingObject(request);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected ModelAndView onSubmit(HttpServletRequest request,
|
||||
HttpServletResponse response, Object command, BindException errors)
|
||||
throws Exception {
|
||||
|
||||
throws Exception {
|
||||
|
||||
FormPreference fp=(FormPreference) command;
|
||||
|
||||
|
||||
List<Preference> listPreference=fp.getPreferences();
|
||||
// to do with the part of core using preferenceManager
|
||||
|
||||
|
||||
return new ModelAndView("choosePreferenceOK");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -74,6 +69,6 @@ public class ChoosePreferenceController extends SimpleFormController {
|
||||
public void setArticleManager(IArticleManager articleManager) {
|
||||
this.articleManager = articleManager;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -60,10 +60,10 @@ public class SArticleController extends SimpleFormController {
|
||||
|
||||
protected Object formBackingObject(HttpServletRequest request) throws ServletException {
|
||||
FormSubmission myArticle = new FormSubmission();
|
||||
myArticle.setTitle("Article's title");
|
||||
myArticle.setTheme("Article's theme");
|
||||
myArticle.setMainauthor("Main author");
|
||||
myArticle.setSecondaryauthor("Secondary authors");
|
||||
myArticle.setTitle("");
|
||||
myArticle.setTheme("");
|
||||
myArticle.setMainauthor("");
|
||||
myArticle.setSecondaryauthor("");
|
||||
return myArticle;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user