Struts - erro ao executar

4 respostas
R

Boa tarde galera, sou iniciante e estou comecando a estudar o struts, baixei uns artigos, video aulas pra comecar, mas ao tentar configurar um primeiro projeto deu um erro ja pesquisei muito, mas quando acho alguem que teve o mesmo erro a pessoa so responde que solucionou e não dá a solução. Então conto com a ajuda de vcs. :cry:

O Erro é esse:

exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 17

14:


15:
Struts2 - Making Bussiness Intelligence

16:
17:
18: Purchases
19: Sales
20:

Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:553)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:457)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

root cause

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]
org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:60)
org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:44)
org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:48)
org.apache.jsp.index_jsp._jspx_meth_sx_005ftabbedpanel_005f0(index_jsp.java:108)
org.apache.jsp.index_jsp._jspService(index_jsp.java:77)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

Meu web.xml
<?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_3_0.xsd"
	id="WebApp_ID" version="3.0">
	<display-name>StrutsApp</display-name>

	<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>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
		<dispatcher>ERROR</dispatcher>
	</filter-mapping>

	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>
</web-app>
meu struts.xml
<?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.enable.DynamicMethodInvocation" value="true" />
	<constant name="struts.devMode" value="true" />
	<constant name="struts.ui.theme" value="simple" />
	
	<package name="default" extends="struts-default">

	</package>
</struts>
meu indexjsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Struts2 - BI</title>
</head>
<body>
	<div align="center">
		<div>Struts2 - Making Bussiness Intelligence</div>

		<sx:tabbedpanel id="Tabs" cssStyle="font-family: Verdana; font-wheght;old; width: 70%">
			<sx:div label="Purchases" theme="ajax" preload="true">Purchases</sx:div>
			<sx:div label="Sales" theme="ajax" preload="true">Sales</sx:div>
		</sx:tabbedpanel>

	</div>
</body>
</html>
Ao retirar o codigo:
<sx:tabbedpanel id="Tabs" cssStyle="font-family: Verdana; font-wheght;old; width: 70%">
			<sx:div label="Purchases" theme="ajax" preload="true">Purchases</sx:div>
			<sx:div label="Sales" theme="ajax" preload="true">Sales</sx:div>
		</sx:tabbedpanel>

da pagina o mesmo execulta sem erros, alguem pode me explicar o que estou fazendo de errado? :?

4 Respostas

R

:?: ninguém pode ajudar?

R

Nem uma resposta :\

R

alguem tem alguma idéia do erro?

kiko_lp_St_jimmy

Tenta retirar a tua tag cssStyle=“font-family: Verdana; font-wheght;old; width: 70%” pois acredito que esteja errada e ve se funciona.

Criado 30 de abril de 2011
Ultima resposta 17 de mai. de 2011
Respostas 4
Participantes 2