关闭

毕设之每天总结 三【12.03.30】

428人阅读 评论(0) 收藏 举报

A类:

/**
 * @author zfss Email: zfss2012@gmail.com
 * @version Date: 2012-3-19,Time: 下午09:30:23
 */
public class A{
	public void rukou(){
		onSubmit();
	}
	protected void onSubmit(){
		
	}
}

B类:

/**
 * @author zfss Email: zfss2012@gmail.com
 * @version Date: 2012-3-30,Time: 下午05:29:51
 */
public class B extends A{
	protected void method(){
		System.out.println("run success");
	}
}

C类:

/**
 * @author zfss Email: zfss2012@gmail.com
 * @version Date: 2012-3-30,Time: 下午05:32:42
 */
public class C extends B{
	
	@Override
	protected void onSubmit(){
		method();
	}
	
	public static void main(String[] args){
		new C().rukou();
	}
}

A类提供运行逻辑,B类提供功能大全,C类具体实现并有取舍的调用B类提供功能


今天遇到的问题:

1.(已解决)javax.el.PropertyNotFoundException:Property 'userId' not found on type com.shu.cms.domain.collection.ProjectEntity

jsp页面上el表达式用错了

以前一直没怎么注意spring mvc 的post 和get的区别。。今天好好看了一下

spring mvc 部分源码:

@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
			throws Exception {

		// Form submission or new form to show?
		if (isFormSubmission(request)) {
			// Fetch form object from HTTP session, bind, validate, process submission.
			try {
				Object command = getCommand(request);
				ServletRequestDataBinder binder = bindAndValidate(request, command);
				BindException errors = new BindException(binder.getBindingResult());
				return processFormSubmission(request, response, command, errors);
			}
			catch (HttpSessionRequiredException ex) {
				// Cannot submit a session form if no form object is in the session.
				if (logger.isDebugEnabled()) {
					logger.debug("Invalid submit detected: " + ex.getMessage());
				}
				return handleInvalidSubmit(request, response);
			}
		}

		else {
			// New form to show: render form view.
			return showNewForm(request, response);
		}
	}

protected boolean isFormSubmission(HttpServletRequest request) {
		return "POST".equals(request.getMethod());
	}


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:70631次
    • 积分:1227
    • 等级:
    • 排名:千里之外
    • 原创:45篇
    • 转载:25篇
    • 译文:0篇
    • 评论:13条
    最新评论