Struts2 org.apache.tiles.util.TilesIOException:jspeException包括路径'/login.jsp';
我对瓷砖和strut2不熟悉。 我无法理解,当我在login.jsp页面中使用html标记时,它工作正常,但同时,如果我在login.jsp页面中的struts标记中编码,那么它会给出错误。我无法理解发生这种情况的原因。下面给出了以下代码和错误..请帮助我 HTTP状态500-内部服务器错误 类型异常报告 消息内部服务器错误 description服务器遇到阻止它的内部错误 不履行这一要求 例外情况 javax.servlet.ServletException:执行标记:jspeException时出错 包括路径“/baseLayout.jsp” 根本原因 org.apache.tiles.tileException:jspeException包括路径 “/baseLayout.jsp” 根本原因 org.apache.tiles.util.TilesIOException:jspeException包括路径 “/baseLayout.jsp” 根本原因 org.apache.tiles.util.TilesIOException:jspeException包括路径 “/login.jsp” 根本原因 找不到Struts dispatcher。这通常是由于 使用Struts标记而不使用关联的过滤器。Struts标签只是 当请求通过其servlet过滤器时可用,该过滤器 初始化此标记所需的Struts dispatcher。-[未知 位置] 请注意,异常的完整堆栈跟踪及其根本原因如下 可在GlassFish服务器开源版4.1日志中找到 web.xmlStruts2 org.apache.tiles.util.TilesIOException:jspeException包括路径'/login.jsp';,struts2,tiles,Struts2,Tiles,我对瓷砖和strut2不熟悉。 我无法理解,当我在login.jsp页面中使用html标记时,它工作正常,但同时,如果我在login.jsp页面中的struts标记中编码,那么它会给出错误。我无法理解发生这种情况的原因。下面给出了以下代码和错误..请帮助我 HTTP状态500-内部服务器错误 类型异常报告 消息内部服务器错误 description服务器遇到阻止它的内部错误 不履行这一要求 例外情况 javax.servlet.ServletException:执行标记:jspeExceptio
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Struts2Example15</display-name>
<context-param>
<param-name>
org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
</param-name>
<param-value>
/WEB-INF/tiles.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.apache.struts2.tiles.StrutsTilesListener
</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
支柱2示例15
org.apache.tiles.impl.basictelescontainer.DEFINITIONS\u CONFIG
/WEB-INF/tiles.xml
org.apache.struts2.tiles.StrutsTilesListener
index.jsp
支柱2
org.apache.struts2.dispatcher.FilterDispatcher
支柱2
/*
struts.xml
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<!-- Configuration for the default package. -->
<package name="default" extends="struts-default">
<result-types>
<result-type name="tiles" class="org.apache.struts2.view.tiles.TilesResult"/>
</result-types>
<action name="loginAction" class="package_entry.loginAction" method="execute">
<result name="getin">welcome.jsp</result>
<result name="user_login">user_login.jsp</result>
</action>
</package>
</struts>
loging.jsp
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<tiles:insertDefinition name="login.def"/>
tiles.xml
login.jsp
<%@taglib uri="/struts-tags" prefix="s"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<s:form>
<s:textfield name="email_id" label="Email"/>
<s:password name="password" label="Password"/>
<s:submit value="login"/>
</s:form>
</body>
</html>
JSP页面
很可能您必须将相对路径添加到每个定义中
比如说改变
value="/login.jsp"/>
在
因此:
<definition name="login.def" extends="baseLayout">
<put-attribute name="title" value="Login form"/>
<put-attribute name="body" value="/WEB-INF/path/to/your/login.jsp"/>
</definition>
此外,我在任何地方都看不到您的平铺渲染器和配置器。您是否已将互动程序添加到pom中?您是否在不执行操作的情况下访问该页面?耶..据我所知,我是通过操作访问该页面的..您还可以检查我的代码,正如我前面提到的。如果是,我访问jsp页面(使用html标记)然后它就不会直接显示页面,但当我使用Struts标记时,它会反映错误
,这通常是由于使用Struts标记而没有关联的过滤器造成的。
这就是错误消息。另外,org.apache.struts2.dispatcher.FilterDispatcher
自S2.1或更高版本以来一直被弃用。请告诉我。如果这是错误,那么我应该如何解决itpom。。???我不是在使用maven,而是在使用netbeans 8.0.2和glassfish server 4.1。您在项目中添加了apache tiles JAR吗?我有Strut2jar,它构成了(commmon beanutil、commons io、strut2 tiles插件、tiles api等)瓷砖所需的jar文件顺便说一句,我已经阅读了十几篇struts2瓷砖教程,所有这些教程都建议只使用Strut2JAR,任何人都可以帮助我,…我仍然在努力解决同样的问题
<%@taglib uri="/struts-tags" prefix="s"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<s:form>
<s:textfield name="email_id" label="Email"/>
<s:password name="password" label="Password"/>
<s:submit value="login"/>
</s:form>
</body>
</html>
value="/login.jsp"/>
value="/WEB-INF/path/to/your/login.jsp"/>
<definition name="login.def" extends="baseLayout">
<put-attribute name="title" value="Login form"/>
<put-attribute name="body" value="/WEB-INF/path/to/your/login.jsp"/>
</definition>