struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ssmtpmailtesting ssmtpmailtesting <ssmtpmailtest...@gmail.com>
Subject Re: http://mybox:8080/struts/hello.action gets HTTP Status 404 - Not Found
Date Sat, 30 Jun 2018 13:55:00 GMT
I solved the problem, this is web.xml

<?xml version="1.0" encoding="UTF-8"?>

<web-app id="MyStrutsApp" version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

    <display-name>Archetype Created Web Application</display-name>

    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
    </filter>

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

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
</web-app>

On Sat, Jun 30, 2018 at 7:52 PM, Dave Newton <davelnewton@gmail.com> wrote:
> That means you're hitting a JSP page with S2 tags without having run
> through an S2 request process, e.g., hitting a JSP page directly.
>
> On Sat, Jun 30, 2018 at 9:14 AM ssmtpmailtesting ssmtpmailtesting <
> ssmtpmailtesting@gmail.com> wrote:
>
>> struts.xml =>
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE struts PUBLIC
>>         "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
>>         "http://struts.apache.org/dtds/struts-2.5.dtd">
>> <struts>
>>     <constant name="struts.devMode" value="true" />
>>
>>     <package name="com.actions" extends="struts-default">
>>         <action name="index">
>>             <result>/index.jsp</result>
>>         </action>
>>
>>         <action name="hello" class="com.actions.HelloWorldAction"
>> method="execute">
>>             <result name="success">/HelloWorld.jsp</result>
>>         </action>
>>     </package>
>> </struts>
>>
>>
>> web.xml
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE struts PUBLIC
>>         "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
>>         "http://struts.apache.org/dtds/struts-2.5.dtd">
>> <struts>
>>     <constant name="struts.devMode" value="true" />
>>
>>     <package name="com.actions" extends="struts-default">
>>         <action name="index">
>>             <result>/index.jsp</result>
>>         </action>
>>
>>         <action name="hello" class="com.actions.HelloWorldAction"
>> method="execute">
>>             <result name="success">/HelloWorld.jsp</result>
>>         </action>
>>     </package>
>> </struts>
>>
>> Still I get error for http://mybox:8080/struts/
>>
>> 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
>>
>>
>>
>> and same error for http://mybox:8080/struts/hello.action
>>
>> On Sat, Jun 30, 2018 at 6:43 PM, Yasser Zamani <yasserzamani@apache.org>
>> wrote:
>> >
>> >
>> > On 6/30/2018 4:23 PM, ssmtpmailtesting ssmtpmailtesting wrote:
>> >> web.xml =>
>> >>
>> >> <!DOCTYPE web-app PUBLIC
>> >>  "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>> >>  "http://java.sun.com/dtd/web-app_2_3.dtd" >
>> >>
>> >> <web-app>
>> >>     <display-name>Archetype Created Web Application</display-name>
>> >>     <filter>
>> >>         <filter-name>struts2</filter-name>
>> >>         <filter-class>org.apache.struts2.dispatcher.FilterDispatcher
>> >> </filter-class>
>> >
>> > The maven pom.xml is using Struts 2.5.16 but web.xml is using Struts
>> > 2.3.x either DTD and filter. The FilterDispatcher is used in the early
>> > Struts2 development, and it’s deprecated since Struts 2.1.3. it’s always
>> > recommended to upgrade the new filter class –
>> StrutsPrepareAndExecuteFilter.
>> >
>> > Regards.
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>> --
> e: davelnewton@gmail.com
> m: 908-380-8699
> s: davelnewton_skype
> t: @dave_newton <https://twitter.com/dave_newton>
> b: Bucky Bits <http://buckybits.blogspot.com/>
> g: davelnewton <https://github.com/davelnewton>
> so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message