struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Srineel Mazumdar <smaz19...@gmail.com>
Subject Re: Issue with running Struts2 project
Date Mon, 05 Nov 2012 10:21:47 GMT
Hi Lukasz,

Thanks for your reply.

I made the following changes based on your suggestion :

1) scope = "prototype" : Added this in applicationContext.xml to avoid
making the action classes as singleton
2) Corrected the package names of the action classes in struts.xml
3) Rechecked struts.xml. It has the following entry :

<action name ="index" class ="com.home.practice.shop.DoNothingAction">
<result name="success">/WEB-INF/jsp/struts/index.jsp<result/>
</action>

Code in DoNothingAction :

public class DoNothingAction extends BaseAction {

/* Public Methods */

public String execute() throws Exception {
return "success";
}
}

Even then I am getting 404 error. Can you please help ?

Regards,
Srineel


On Mon, Nov 5, 2012 at 1:20 PM, Lukasz Lenart <lukaszlenart@apache.org>wrote:

> 2012/11/5 Srineel Mazumdar <smaz19584@gmail.com>:
> > Hi,
> >
> > I am new to Struts2 and for learning I am doing my own project. I am
> facing
> > the following issue and need help in fixing:
> >
> > http://localhost:8081/NewPetstore : This URL is opening the index page.
> >
> > However
> > http://localhost:8081/NewPetstore/shop/index.do shows 404 .
>
> There is no action named index in namespace /shop, second you're
> mixing Struts 1 with Struts 2 which is wrong :\ Next thing, your
> actions are Singletons which is very, very bad. Maybe start with
> something simpler and add other components step by step ;-)
>
>
> Regards
>
> --
> Ɓukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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