D4vidz 2017-07-27 06:02 采纳率: 0%
浏览 1321

struts的过滤器没有配置好导致无法使用标签?

 <!-- struts2的框架的核心过滤器的配置 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

```<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h1>保存商品的页面</h1>
<s:form action="" method="post" namespace="/" theme="simple" >
<table border="1" width="400">
<tr>
<td>商品名称</td>
<td><s:textfield name="pname"/></td>
</tr>
<tr>
   <td>商品价格</td>
   <td><s:textfield name="price"/></td>
   </tr>
<tr>
   <td colspan="2"><input type="submit" value="添加"/></td>
</tr>
</table>
</s:form>

```HTTP Status 500 – Internal Server Error

Type Exception Report

Message An exception occurred processing JSP page /addProduct.jsp at line 12

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /addProduct.jsp at line 12

9:
10:


11:

保存商品的页面


12:
13:
14:
15:

Servlet.service() for servlet [jsp] in context with path [/ssh] 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]] with root cause


商品名称
  • 写回答

2条回答 默认 最新

  • wuzhiping2017 2017-07-28 23:51
    关注

    你这是Struts的jar包没有?

    评论

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序