1.Could not load class Interceptor2/Myinterceptor. Perhaps it exists but certain dependencies are not available? - interceptor
解決:缺少log4j.jar
2.當你的action處理類繼承ActionSupport時
public class Reg extends ActionSupport {
private String username;
private String mymsg;
private String password1;
private String password2;
private Date birthday;
public String execute() throws Exception {}
form表單的action一定加上“.action”<s:form id="id" action="Interceptor2/reg.action">
否則出現
type Status report
message /Test/xInterceptor2/reg.jsp
description The requested resource (/Test/xInterceptor2/reg.jsp) is not available.錯誤
3
在struts2de 1.6以前版本,都是用<s:datepicker>標簽來獲取時間,1.8後可以用struts-dojo.plugin裡的<sx:datetimepicker>標簽獲取時間。
1.struts2-dojo-plugin-2.1.6.jar引入到自己的項目中。
2.jsp中加入如下內容
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/ struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
3. <head>中加入下列
<head>
<s:head theme="xhtml"/>
<sx:head parseContent="true"/>
</head>
4.頁面中使用
<sx:datetimepicker name="birthday" lable="請求時間" displayFormat="yy-MM-dd" />