欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Struts开发问题集锦

程序员文章站 2022-05-28 20:47:41
1.could not load class interceptor2/myinterceptor. perhaps it exists but certain dependencies are n...

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.

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" />