页面登录问题

zhenjianye3 2011-09-15 05:20:24
org.apache.jasper.JasperException: An exception occurred processing JSP page /login/login.jsp at line 32

29: <table align="center">
30: <tr align="center">
31: <td align="center" height="400">
32: <s:form action="addTe">
33: <s:textfield name="te.name" id="name"></s:textfield>
34: <s:textfield name="te.pass" id="pass"></s:textfield>
35: <s:submit value="鐧婚檰"></s:submit>


...全文
111 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhenjianye3 2011-09-17
  • 打赏
  • 举报
回复
get/set是必须配置的,打开login.jsp就出上边的代码问题
chen442077762 2011-09-16
  • 打赏
  • 举报
回复
<s:form action="addTe" method="post"><s:textfield name="te.name" id="name"></s:textfield>
<s:textfield name="te.pass" id="pass"></s:textfield>
<s:submit value="登陆"></s:submit>
</s:form>

还有你的te配置了bean没有,action内的get和set方法等。
zhenjianye3 2011-09-16
  • 打赏
  • 举报
回复
严重: Servlet.service() for servlet jsp threw exception
The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]
at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:60)
at org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:52)
at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:49)
at org.apache.jsp.login.login_jsp._jspx_meth_s_005fform_005f0(login_jsp.java:129)
at org.apache.jsp.login.login_jsp._jspService(login_jsp.java:99)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)
at java.lang.Thread.run(Unknown Source)
这是进入页面后,tomcat控制台这里出的错
zhenjianye3 2011-09-16
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 wuhuipengwhp 的回复:]

struts里面的<constant name="struts.custom.i18n.resources"
value="ApplicationResources" />改成<constant name="struts.i18n.encoding"
value="gbk" />就没有问题了
[/Quote]

还是没法进入登录页面
wuhuipengwhp 2011-09-15
  • 打赏
  • 举报
回复
struts里面的<constant name="struts.custom.i18n.resources"
value="ApplicationResources" />改成<constant name="struts.i18n.encoding"
value="gbk" />就没有问题了
zhenjianye3 2011-09-15
  • 打赏
  • 举报
回复
我的编码是utf-8呀,怎么不对吗
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'login.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->

</head>

<body bgcolor="blue">
<table align="center">
<tr align="center">
<td align="center" height="400">
<s:form action="addTe">
<s:textfield name="te.name" id="name"></s:textfield>
<s:textfield name="te.pass" id="pass"></s:textfield>
<s:submit value="登陆"></s:submit>
</s:form>
</td>
</tr>
</table>
</body>
</html>






<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
<constant name="struts.custom.i18n.resources"
value="ApplicationResources" />
<constant name="struts.i18n.encoding" value="utf-8" />
<constant name="struts.custom.i18n.resources" value="message" />
<package name="zhou" extends="struts-default">
<interceptors>
<interceptor name="roleInterceptor" class="interceptor.RoleInterceptor">
</interceptor>
</interceptors>

<action name="addTe" class="com.action.TeAction">
<!-- <result>/test/listte.jsp</result> -->
<result type="redirect">
/listTe.action
</result>
</action>
<action name="delte" class="com.action.TeAction" method="delTe">
<result type="redirect">
/listTe.action
</result>
</action>
<action name="updte" class="com.action.TeAction" method="updTe">
<result>/test/update.jsp</result>
</action>
<action name="updte1"
class="com.action.TeAction" method="updte">

<result type="redirect">listTe.action</result>

</action>
<action name="listTe" class="com.action.TeAction" method="alllist">
<result>/test/listte.jsp</result>
</action>
<!-- 用户登陆 -->
<action name="userlogin" class="com.action.UsersAction" method="userLogin">
<result name="admin">/test/addte.jsp</result>
<result name="input">/login/login.jsp</result>
</action>
</package>
</struts>
哪里不对吗
zhenjianye3 2011-09-15
  • 打赏
  • 举报
回复
我先看看
softroad 2011-09-15
  • 打赏
  • 举报
回复
<%@ page language="java" pageEncoding="UTF-8"%>
小笨熊 2011-09-15
  • 打赏
  • 举报
回复
<s:form action="addTe">
你结束了没?

其次怎么出现乱码了。估计就是乱码惹的祸

58,454

社区成员

发帖
与我相关
我的任务
社区描述
Java Eclipse
社区管理员
  • Eclipse
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧