Hi,

Also I would like to add :

The url now I am using is

http://localhost:8081/NewPetstore/shop/index.action.

Now the error is coming as : *There is no Action mapped for namespace /shop
and action name index*
*
*
*In struts.xml : *
*
*
<package name="newpetstore" extends="struts-default" namespace="/shop">
*
*
<action name ="index" class ="com.home.practice.shop.DoNothingAction">
<result name="success">/WEB-INF/jsp/struts/index.jsp<result/>
</action>

Seems I am making a silly mistake somewhere but I am unable to figure in
out. Please help.

Regards,
Srineel


On Mon, Nov 5, 2012 at 3:51 PM, Srineel Mazumdar <smaz19...@gmail.com>wrote:

> 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 <lukaszlen...@apache.org>wrote:
>
>> 2012/11/5 Srineel Mazumdar <smaz19...@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-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>

Reply via email to