Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am new to Struts. I have installed all the struts2 plugins in Netbeans 8.1. The server that I'm using is Glassfish 4.1.1.  When I run the following code I get: 

HTTP Status 500 - Internal Server Error 
type Exception report 

messageInternal Server Error 

descriptionThe server encountered an internal error that prevented it from fulfilling this request. 

exception 

org.apache.jasper.JasperException: 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] 
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] 
note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.1.1 logs. 

GlassFish Server Open Source Edition 4.1.1 

and I've used this line in my code: 
<%@taglib uri="/struts-tags" prefix="s"%>
web.xml file 

<?xml version="1.0" encoding="UTF-8"?> 
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"> 
    <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> 
    <session-config> 
        <session-timeout> 
            30 
        </session-timeout> 
    </session-config> 
    <welcome-file-list> 
        <welcome-file>index.html</welcome-file> 
    </welcome-file-list> 
</web-app>


What I have tried:

I've referred more solutions indicating the missing jar files, but I have all of them but still the JasperException occurs. Could anyone provide a solution for this? 
Thanks in advance
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900