Java论坛网»Java技术»急!!关于错误提示的问题~?
急!!关于错误提示的问题~?
问?:
我在用struts+freemarker开发一个登陆,注册系统的时候遇到如下错误提示~
type Status report
message Servlet action is not available
description The requested resource (Servlet action is not available) is not available.
我想问一下该如何解决这个问题呢?
type Status report
message Servlet action is not available
description The requested resource (Servlet action is not available) is not available.
我想问一下该如何解决这个问题呢?
答!: 1:
我是这样做的~一开始我用
<% String context = request.getContextPath();%>
<script>
location.href="<%=context%>/login.do";
</script>
提交给action处理
<action
attribute="userLoginForm" input="/login.do" name="userLoginForm" validate="false" path="/userLogin" scope="request" type="com.login.struts.action.UserLoginAction">
<forward name="success" path="/WEB-INF/ftl/userLoginSuccess.htm" />
<forward name="failure" path="/WEB-INF/ftl/erro.htm" />
</action>
<action path="/login" type="org.apache.struts.actions.ForwardAction"
parameter="/WEB-INF/ftl/userLogin.ftl">
</action>
这样应该可以显示出登陆页面userLogin.ftl,怎么报Servlet action 错误呢?
<% String context = request.getContextPath();%>
<script>
location.href="<%=context%>/login.do";
</script>
提交给action处理
<action
attribute="userLoginForm" input="/login.do" name="userLoginForm" validate="false" path="/userLogin" scope="request" type="com.login.struts.action.UserLoginAction">
<forward name="success" path="/WEB-INF/ftl/userLoginSuccess.htm" />
<forward name="failure" path="/WEB-INF/ftl/erro.htm" />
</action>
<action path="/login" type="org.apache.struts.actions.ForwardAction"
parameter="/WEB-INF/ftl/userLogin.ftl">
</action>
这样应该可以显示出登陆页面userLogin.ftl,怎么报Servlet action 错误呢?
答!: 2:
有人知道原因的吗?
答!: 3:
为什么我去掉
<data-sources >
<data-source key="mssqldb" type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="minCount" value="1" />
<set-property property="password" value="sa" />
<set-property property="maxCount" value="5" />
<set-property property="user" value="sa" />
<set-property property="driverClass" value="com.microsoft.jdbc.sqlserver.SQLServerDriver" />
<set-property property="description" value="MSSQL" />
<set-property property="url" value="jdbc:microsoft:sqlserver://localhost:1433/user" />
<set-property property="autoCommit" value="true" />
<set-property property="readOnly" value="false" />
<set-property property="loginTimeout" value="" />
</data-source>
</data-sources>
就不出现这个错误了呢?
<data-sources >
<data-source key="mssqldb" type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="minCount" value="1" />
<set-property property="password" value="sa" />
<set-property property="maxCount" value="5" />
<set-property property="user" value="sa" />
<set-property property="driverClass" value="com.microsoft.jdbc.sqlserver.SQLServerDriver" />
<set-property property="description" value="MSSQL" />
<set-property property="url" value="jdbc:microsoft:sqlserver://localhost:1433/user" />
<set-property property="autoCommit" value="true" />
<set-property property="readOnly" value="false" />
<set-property property="loginTimeout" value="" />
</data-source>
</data-sources>
就不出现这个错误了呢?
答!: 4:
提示是action无效,观察一下出错的地址.看一下action的路径
答!: 5:
action的路径的路径是对的啊~
答!: 6:
只是猜测
location.href="<%=context%>/login.do";改成location.href="<%=context%>login.do";
<set-property property="url" value="jdbc:microsoft:sqlserver://localhost:1433/user" />
jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=user
location.href="<%=context%>/login.do";改成location.href="<%=context%>login.do";
<set-property property="url" value="jdbc:microsoft:sqlserver://localhost:1433/user" />
jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=user
答!: 7:
type Status report
message Servlet action is not available
description The requested resource (Servlet action is not available) is not available.
这段信息提示的是你的配置路径有问题
仔细检查你的配置action
message Servlet action is not available
description The requested resource (Servlet action is not available) is not available.
这段信息提示的是你的配置路径有问题
仔细检查你的配置action
答!: 8:
你的配置有问题,简化一下你的配置吧!!你不就jsp页面提交要去找login.do对应得com.login.struts.action.UserLoginAction 对吗?你改一下配置:
<action
name="userLoginForm" validate="false" path="/userLogin" scope="request" type="com.login.struts.action.UserLoginAction">
<forward name="success" path="/WEB-INF/ftl/userLoginSuccess.htm" />
<forward name="failure" path="/WEB-INF/ftl/erro.htm" />
</action>
你在jsp里修改成:
location.href="<%=context%>/userLogin.do
试试.....应该可以的....
<action
name="userLoginForm" validate="false" path="/userLogin" scope="request" type="com.login.struts.action.UserLoginAction">
<forward name="success" path="/WEB-INF/ftl/userLoginSuccess.htm" />
<forward name="failure" path="/WEB-INF/ftl/erro.htm" />
</action>
你在jsp里修改成:
location.href="<%=context%>/userLogin.do
试试.....应该可以的....
相关JAVA教程:
谁给个resin3.0.19 windows版本---100分相赠
发现JAVA的开源BLOG还是不错的,大家进来瞧瞧~
JBoss配置数据源问题
关于水晶报表显示数据的问题,请高人指点,谢谢!!!
我的webservice 返回xml 是返回Document吗
用myeclise+hibernate+struts中的问题,个人认为这个问题应该有点普遍
简单远程方法调用
请问,有没有好的工具可以把VJ++开发的项目移植到JAVA2?
删除直线的方法
JSP连接数据库问题?
hibernate问题
请指教<bean:define>标记的各个属性的含义