问个问题,struts设置,解决了份大大地有!!!

shan1119 2005-02-23 04:24:14
路径:
主目录下有:WEB-INF文件夹,login.jsp文件
WEB-INF文件夹下有:classes文件夹和struts-config.xml,struts-html.tld,web.xml
然后是:classes/com/javapro/struts/(好多java文件)
struts-config.xml:

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<struts-config>
<form-beans>
<form-bean name="loginForm" type="com.javapro.struts.LoginForm"/>
</form-beans>

<action-mappings>
<action path="/login"
type="com.javapro.struts.LoginAction"
name="loginForm"
scope="request"
input="/login.jsp">
<forward name="success" path="/mainMenu.jsp"/>
</action>
<action path="/logout" type="com.javapro.struts.LogoutAction">
<forward name="success" path="/login.jsp"/>
</action>
<action path="/viewSecret" forward="/viewSecret.jsp"/>

</action-mappings>
</struts-config>

web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">


<web-app>

<!-- Action Servlet Configuration -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>com.javapro.struts.ApplicationResources</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>

<!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<!-- The Welcome File List -->
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>

<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>

</web-app>

tomcat下server.xml也配好了,可就是出错,错误如下:

type Exception report

message Internal Server Error

description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.

exception

org.apache.jasper.compiler.CompileException: /login.jsp(1,0) クラス org.apache.struts.taglib.html.HtmlTag をロードできません
at org.apache.jasper.compiler.TagBeginGenerator.init(TagBeginGenerator.java:139)
at org.apache.jasper.compiler.JspParseEventListener$GeneratorWrapper.init(JspParseEventListener.java:822)
at org.apache.jasper.compiler.JspParseEventListener.addGenerator(JspParseEventListener.java:151)
at org.apache.jasper.compiler.JspParseEventListener.handleTagBegin(JspParseEventListener.java:1032)
at org.apache.jasper.compiler.DelegatingListener.handleTagBegin(DelegatingListener.java:217)
at org.apache.jasper.compiler.DelegatingListener.handleTagBegin(DelegatingListener.java:212)
at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:878)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1099)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:213)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:536)



这是别人的一个例子,不知道是不是哪儿出了问题,还是少配了什么,望高手指教,多谢了,感觉分少的话,我可以再加,等级不够可以另开贴赠分
...全文
102 点赞 收藏 17
写回复
17 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
wgj828451 2005-02-23
这是标记错误,是标记没有配对。我以前遇到过,好好检查自己的标记。
回复
shan1119 2005-02-23
我有struts.jar 还有common...一堆是吗?这些就是解包struts出来的?
回复
jFresH_MaN 2005-02-23
WEB-INF下面建lib文件夹,然后把那一堆需要的包放进去就成了
回复
shan1119 2005-02-23
可能是我改了配置文件后没重启猫,现在只能这么想
回复
jFresH_MaN 2005-02-23
好象就是在WEB-INF文件夹缺少好多的jar文件
struts.jar,...
回复
jFresH_MaN 2005-02-23
好象就是在WEB-INF文件夹缺少好多的jar文件
struts.jar,...
回复
shan1119 2005-02-23
好了,不知道是什么问题,莫名其妙的好了,谢谢各位
回复
shan1119 2005-02-23
这个
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html locale="true">
<head>
<title>Login Page</title>
<html:base/>
</head>
<body>

<html:errors/>

Please enter your user name and password
<br>

<html:form action="/login" focus="userName">
<table>
<tr>
<td>User Name:</td>
<td><html:text property="userName"/>
</tr>
<tr>
<td>Password:</td>
<td><html:password property="password" redisplay="false"/>
</tr>
<tr>
<td colspan=2 align=right><html:submit property="submit" value="Login"/></td>
</tr>
</table>
</html:form>

</body>
</html:html>
回复
shan1119 2005-02-23
sturts的包是什么?在哪有下?
回复
jFresH_MaN 2005-02-23
根本看不出问题
需要看看login.jsp
回复
myth822 2005-02-23
org.apache.jasper.compiler.CompileException: /login.jsp(1,0)

编译器编译时出现错误 你的login.jsp有问题,有没有lamboz之类的插件装以下,查一下错误
回复
programeyonger 2005-02-23
从你的报错情况来看是你的login.jsp文件不能编译成servlet,你查看是不是你的login.jsp有问题?从配置文件找找看是不是请求的路径上有问题。
回复
snakeqi 2005-02-23
没有把sturts的包放到/WEB-INF/lib目录下
回复
zeq258 2005-02-23
配置没有什么问题,你有没有把struts的包,引进来!
回复
zeq258 2005-02-23
我也是个struts出学者,也遇到过这样的问题,
建议你用jbuilder开发环境!
回复
binny0532 2005-02-23
你的login页面呢?
先帮你顶!
回复
missbo 2005-02-23
又是一个跟我一样的水平!我昨天开始学和JAVA。你呢?
回复
相关推荐
发帖
Java EE
创建于2007-09-28

6.6w+

社区成员

J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
申请成为版主
帖子事件
创建了帖子
2005-02-23 04:24
社区公告
暂无公告