struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Sattler <tomsatt...@gmail.com>
Subject Re: [S2] Trouble getting started
Date Sun, 27 Sep 2015 13:14:33 GMT
try struts2builder.sourceforge.net



On Sunday, September 27, 2015, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Yaragalla,
>
> On 9/27/15 1:38 AM, Yaragalla Muralidhar wrote:
> > Try the following.
> >
> > <package name="default" namespace="/" extends="struts-default">
> > <action name="list" class="my.package.business.ListAction"> <result
> > *name="success"*  >/WEB-INF/list.jsp</result> </action> </package>
>
> No change. Note that I see nothing in the TRACE log for Struts (or,
> really, anything) when I make the request to
> http://localhost:8080/list.action. It's almost as if the Filter does
> not run at all.
>
> What's the default value of <result>'s "name" attribute? It's not
> defined in the DTD:
>
> <!ELEMENT result (#PCDATA|param)*>
> <!ATTLIST result
>     name CDATA #IMPLIED
>     type CDATA #IMPLIED
> >
>
> Thanks,
> - -chris
>
> > On Sun, Sep 27, 2015 at 3:00 AM, Christopher Schultz <
> > chris@christopherschultz.net <javascript:;>> wrote:
> >
> > All,
> >
> > I'm working on a fresh project and using Struts 2 for the first
> > time. I've been using Struts 1 for more than 10 years and I
> > generally know my way around web applications.
> >
> > I just can't seem to get a fairly simple setup working. I'm
> > intending to use XML-based configuration and not annotation-based
> > configuration.
> >
> > Here's what I've got:
> >
> > * Struts 2.3.24.1 * Tomcat 8.0.24 * A simple web app
> >
> > My web.xml looks like this: <filter> <description> Struts 2 action
> > filter. </description> <filter-name>struts2</filter-name>
> >
> > <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAnd
> Ex
> >
> >
> ecuteFilter</filter-class>
> > <init-param> <param-name>actionPackages</param-name>
> > <param-value>my.package.business</param-value> <!-- do I need this
> > if I'm going to use XML-based config? --> </init-param> </filter>
> >
> > <filter-mapping> <filter-name>struts2</filter-name>
> > <url-pattern>/*</url-pattern> </filter-mapping>
> >
> > My struts.xml looks like this:
> >
> > <?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.devMode" value="true" />
> >
> > <package name="default" namespace="/" extends="struts-default">
> > <action name="list" class="my.package.business.ListAction">
> > <result>/WEB-INF/list.jsp</result> </action> </package>
</struts>
> >
> > I have a class, my.package.business.ListAction which has a
> >
> > public String execute()
> >
> > method. I return "success" from this method (unless an exception
> > is thrown). During startup, I can see that Struts/XWork is being
> > initialize d:
> >
> > 26-Sep-2015 17:19:32.613 FINE [localhost-startStop-1]
> > com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.debu
> g
> >
> >
> Loaded
> > list in 'default' package:{ActionConfig //list
> > (my.package.business.ListAction) - action -
> > file:/path/to/deploy/webapps/ROOT/WEB-INF/classes/struts.xml:
> > 9:68}
> >
> > When I try to access http://localhost:8080/list.action, I get a
> > 404 response with nothing in the logs (except the access log:
> > request to /list.action resulted in a 404).
> >
> > I'm sure I'm missing something super simple, here. Can anyone offer
> > a suggestion?
> >
> > Thanks, -chris
> >>
> >> ---------------------------------------------------------------------
> >>
> >>
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org <javascript:;>
> >> For additional commands, e-mail: user-help@struts.apache.org
> <javascript:;>
> >>
> >>
> >
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJWB+T8AAoJEBzwKT+lPKRYvhIP/RTBeHWCeF9X30cOcOUZsWJG
> /fYwTOVy3MFCBpdPuiOKwvB0WoketuobsV0T3Qm3qj6Frgi6gfBmeSZtXSV3Osug
> RiYj64ZDeVI5UJE8axrp5uNyDySggBcgRxivL5OHkf5xjFGcTxdpVjGhF20/iUm8
> xJbkcRn6oXTKhC0xC7JxWAf2K8XI5se+BQAbl9aSPGacDHnseDasfFNsNiaWtAUF
> 7aMg5Q5FNIS3EQP/1JMQwH5i1o6WDtBhTk2bjGXn31bw7bVG1Ab1ce+HIfB2V1uG
> WDt7NuIicl0JiBswvHKeidDfs8LbeR3UyJC543fW2iC1MPKSstHK2voSf/u7jwNC
> s1bULHC4ssupMcIh9HuVZWFecxfKO6/eSiAY2SHZ6SHHvaQAWvbjyQ+4+9rSnAwB
> /tUIFqfhlR1ngPBdOVE4EnGctcck+TVFLso0MovDSXcbpIRyWUni66Ik4u8KFbpB
> Y3HQONn0OGJfC6XymduwO1tyrMLrvKDA07KDpLrtRxHsr/gjSBD4rOswwepBpGUc
> NfKhRWzLPPCnJQxHp/2Z5m4NPmW/hCyltonbQ007ho0LBt+OysisRxjRUAaKkx/Z
> sxKjVbWoPWQ+l1wzGIeCh12e38dOhXUWXNj5g44TFYobAz3WCAmWdd7SPt4vr1If
> ERHlhVfBfRI3YFuYxk17
> =Uji8
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org <javascript:;>
> For additional commands, e-mail: user-help@struts.apache.org
> <javascript:;>
>
>

-- 
Sent from my iPhone

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message