ssh整合错误,急~~~
什么错啊````````我在````struts配置如:<actionattribute="userForm"
name="userForm"
path="/userAction"
scope="request"
parameter="method"
input="/userslist.jsp"
type="org.springframework.web.struts.DelegatingActionProxy" validate="true">
<forward name="getUsers" path="/user/userslist.jsp"/>
<forward name="getUser" path="/user/user.jsp"/>
<forward name="addUser" path="/user/adduser.jsp"/>
<forward name="updateUser" path="/user/failure.jsp"/>
<forward name="returnUser" path="/user/userslist.jsp"/>
<forward name="deleteUser" path="/user/success.jsp"/>
<forward name="queryUser" path="/user/userslist.jsp"/>
<forward name="addUserPage" path="/user/adduser.jsp"/>
</action>
在spring中配置如:
<bean name="/userAction"
class="com.xiaoxiong.oa.oa.web.action.UserAction" abstract="false"
singleton="false" lazy-init="default" autowire="default"
dependency-check="default">
<property name="userService">
<ref bean="UserService" />
</property>
</bean>
jsp:如:
<a href="userAction.do?method=getUsers&&flag=1">进入管理单元</a>
action 如:
*/
public ActionForward getUsers(
ActionMapping mapping,
ActionForm form,
HttpServletRequest req,
HttpServletResponse res)throws Exception{
String flag=req.getParameter("flag");
int totalRows=userService.getRows();
String currentPage=req.getParameter("currentPage");
String pagerMethod=req.getParameter("pagerMethod");
Pager pager=pagerService.getPager(currentPage, pagerMethod, totalRows);
List UserList=userService.getUser(pager.getPageSize(), pager.getStartRow());
req.setAttribute("UserList", UserList);
req.setAttribute("PAGER", pager);
req.setAttribute("flag", flag);
req.setAttribute("totalRows", String.valueOf(totalRows));
return mapping.findForward("getUsers");
}
急啊````````我qq:103531536 小弟谢谢那~~~~~~~`
搜索更多相关主题的帖子:
ssh
----------------解决方案--------------------------------------------------------
报:404错误;找不到userAction.do
???
----------------解决方案--------------------------------------------------------
你这个问题有几种可能``
1、你并没有定义 userAction.do
2、配置文件出现错误
3、开发包没有引对``
光从你贴的这个 是看不出来的
----------------解决方案--------------------------------------------------------
我再struts中有userAction啊````````
在控制台出现了
unknownHostexception错误````
包好象rt.jar没有`但我该了也还是出现unknownHostexception这个错误```
那位大哥给我说说```我把原程序发给`````````
谢谢那````````` qq:103831536
我搞了好久了还是这个错`我始终都找不到`````
----------------解决方案--------------------------------------------------------
unknownHostexception的问题解决那`````原来是版本问题```````
不过现在有出现新的问题:
2007-8-12 12:06:21 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet action threw exception
java.lang.NullPointerException
at com.xiaoxiong.oa.oa.web.action.UserAction.getAllUsers(UserAction.java:294)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:589)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.xiaoxiong.oa.commons.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:122)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
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:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
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:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
这又是什么问题啊`````````
----------------解决方案--------------------------------------------------------
在问个问题`````````
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /user/userslist.jsp(112,0) Unterminated <html:link tag
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:132)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1670)
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1004)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1272)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1449)
org.apache.jasper.compiler.Parser.parse(Parser.java:133)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:167)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.xiaoxiong.oa.commons.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:122)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs.
--------------------------------------------------------------------------------
Apache Tomcat/6.0.14
这是jsp文件:
<%@page pageEncoding="GBK" contentType="text/html; charset=GBK" import="com.xiaoxiong.oa.commons.Pager;"%>
<%@ taglib uri="struts-html" prefix="html" %>
<%@ taglib uri="struts-logic" prefix="logic" %>
<%@ taglib uri="struts-bean" prefix="bean" %>
<%
String flag=(String)request.getAttribute("flag");
String totalRows=(String)request.getAttribute("totalRows");
String fieldname="";
String value="";
if(flag.equals("2")){
fieldname=(String)request.getAttribute("fieldname");
value=(String)request.getAttribute("value");
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK"/>
<title></title>
<script language = "JavaScript">
function btnQuery() {
if(myfm.value.value=="")
{
alert("请输入查询关键字!");
}else{
window.location.href="<%=request.getContextPath()%>/userAction.do?method=queryUser&&flag=2&&fieldname="+myfm.fieldname.value+"&&value="+myfm.value.value;
}
}
</script>
</head>
<body>
<form name="myfm" method="post">
<table border="1">
<tr>
<td>
<a href="<%=request.getContextPath()%>/userAction.do?method=getAllUsers&&flag=1">察看所有记录</a>
</td>
<td>
<a href="<%=request.getContextPath()%>/userAction.do?method=addUserPage&&flag=<%=flag%>&&fieldname=<%=fieldname%>&&value=<%= value%>">添加</a>
</td>
<td>
<select name="fieldname" >
<option value="username">用户</option>
<option value="name">真实姓名</option>
<option value="tel">电话</option>
<option value="cellphone">手机</option>
<option value="address">地址</option>
<option value="email">邮箱</option>
</select>
<input value="" name="value" />
<a href="#" onclick="btnQuery()">查询</a>
</td>
</tr>
</table>
<br>
<br>
<table border="1">
<tr>
<!-- <td width="14">id</td>-->
<td width="241">用户</td>
<td width="56">密码</td>
<td width="68">真实姓名</td>
<td width="38">tel</td>
<td width="74">电话</td>
<td width="86">邮箱)</td>
<td width="81">地址</td>
</tr>
<logic:iterate id="user" name="userList">
<tr>
<!-- <td><bean:write name="user" property="id"/></td>-->
<td><a href="<%=request.getContextPath()%>/userAction.do?method=getUser&&flag=<%=flag%>&&id=<bean:write name="user" property="id"/>&&flag=<%= flag%>&&fieldname=<%=fieldname%>&&value=<%= value%>"><bean:write name="user" property="username"/></a></td>
<td><bean:write name="user" property="passwd"/></td>
<td><bean:write name="user" property="name"/></td>
<td><bean:write name="user" property="tel"/></td>
<td><bean:write name="user" property="cellphone"/></td>
<td><bean:write name="user" property="email"/></td>
<td><bean:write name="user" property="address"/></td>
</tr>
</logic:iterate>
<tr>
<%if(flag.equals("1")){%>
<td colspan="8" align="right" class="head">
共有<%=totalRows%>条记录
第<bean:write name="PAGER" property="currentPage"/>页
共<bean:write name="PAGER" property="totalPages"/>页
<html:link action="<%=request.getContextPath()%>/userAction.do?method=getAllUsers&&flag=1&&pagerMethod=first" paramName="PAGER" paramProperty="currentPage" paramId="currentPage">首页</html:link>
<html:link action="<%=request.getContextPath()%>/userAction.do?method=getAllUsers&&flag=1&&pagerMethod=previous" paramName="PAGER" paramProperty="currentPage" paramId="currentPage">上一页</html:link>
<html:link action="<%=request.getContextPath()%>/userAction.do?method=getAllUsers&&flag=1&&pagerMethod=next" paramName="PAGER" paramProperty="currentPage" paramId="currentPage">下一页</html:link>
<html:link action="<%=request.getContextPath()%>/userAction.do?method=getAllUsers&&flag=1&&pagerMethod=last" paramName="PAGER" paramProperty="currentPage" paramId="currentPage">尾页</html:link>
</td>
<%}else if(flag.equals("2")){%>
<% Pager pager=(Pager)request.getAttribute("PAGER");%>
<td width="50" colspan="8" align="right" class="head">
共有<%=totalRows%>条记录
第<bean:write name="PAGER" property="currentPage"/>页
共<bean:write name="PAGER" property="totalPages"/>页
<a href="<%=request.getContextPath()%>/userAction.do?method=getAllUsers&&flag=2&&fieldname=<%=fieldname%>&&value=<%= value%>&&pagerMethod=first&¤tPage=<%=pager.getCurrentPage()%>" >首页</a>
<a href="<%=request.getContextPath()%>/userAction.do?method=getAllUsers&&flag=2&&fieldname=<%=fieldname%>&&value=<%= value%>&&pagerMethod=previous&¤tPage=<%=pager.getCurrentPage()%>" >上一页</a>
<a href="<%=request.getContextPath()%>/userAction.do?method=getAllUsers&&flag=2&&fieldname=<%=fieldname%>&&value=<%= value%>&&pagerMethod=next&¤tPage=<%=pager.getCurrentPage()%>" >下一页</a>
<a href="<%=request.getContextPath()%>/userAction.do?method=getAllUsers&&flag=2&&fieldname=<%=fieldname%>&&value=<%= value%>&&pagerMethod=last&¤tPage=<%=pager.getCurrentPage()%>" >尾页</a>
</td>
<%}%>
</tr>
</table>
</form>
</body>
</html>
----------------解决方案--------------------------------------------------------
我实在是找不出来来````````前面的问题都解决了```````
----------------解决方案--------------------------------------------------------