You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by JG Flowers <Je...@yahoo.co.uk> on 2008/06/05 12:53:11 UTC

Cannot retrieve ActionForward named...

I've been trying to learn Struts and come unstuck on it's integration with
Tiles.
I've been following along with Jason Holmes Struts Complete Ref 2nd ed for
(Struts 1)
The source associated to book can be downloaded from 
http://www.jamesholmes.com/StrutsTCR/StrutsTCR2nd-code.zip here 
Chapter 7 is the area I'm experiencing problems with..

When I try and access the deployed app in Tomcat 6 as follows:
http://localhost:9090/MiniHR/
I get the exception:
Cannot create rewrite URL: java.net.MalformedURLException: Cannot retrieve
ActionForward named search

This leads me to believe that the error has to be related to index.jsp, the
“welcome” file in the web.xml.
I am assuming the following snippet of code is the culprit:

<html:link action="/viewSearch">Search for Employees</html:link>

Action forward named search… Hmm.

Struts-config.xml has the following in it:
<?xml version="1.0"?>

<!DOCTYPE struts-config PUBLIC
  "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
  "http://struts.apache.org/dtds/struts-config_1_3.dtd">

<struts-config>

  <!-- Form Beans Configuration -->
  <form-beans>
    <form-bean name="searchForm"
               type="com.jamesholmes.minihr.SearchForm"/>
  </form-beans>

  <!-- Action Mappings Configuration -->
  <action-mappings>
    <action path="/viewSearch"
         forward="search.page"/>

    <action path="/search"
            type="com.jamesholmes.minihr.SearchAction"
            name="searchForm"
           scope="request"
        validate="true"
           input="search.page"/>
  </action-mappings>

  <!-- Message Resources Configuration -->
  <message-resources
    parameter="com.jamesholmes.minihr.MessageResources"/>

  <!-- Tiles Configuration -->
  <plug-in className="org.apache.struts.tiles.TilesPlugin">
    <set-property property="definitions-config"
                     value="/WEB-INF/tiles-defs.xml"/>
  </plug-in>

</struts-config>
 

tiles-defs.xml has the following in it:
<?xml version="1.0"?>

<!DOCTYPE tiles-definitions PUBLIC
  "-//Apache Software Foundation//DTD Tiles Configuration 1.3//EN"
  "http://struts.apache.org/dtds/tiles-config_1_3.dtd">

<tiles-definitions>

  <!-- Main Layout -->
  <definition name="main.layout" path="/mainLayout.jsp">
	  <put name="title"  value=""/>
	  <put name="header" value="/header.jsp"/>
	  <put name="body"   value=""/>
	  <put name="footer" value="/footer.jsp" />
  </definition>

  <!-- Search Page -->
  <definition name="search.page" extends="main.layout">
	  <put name="title"  value="ABC, Inc. Human Resources Portal - Employee
Search"/>
	  <put name="body"   value="/search.jsp"/>
  </definition>

</tiles-definitions>

Is there an obvious error that I need to correct here?
It's got be baffled at the moment.
Cheers in advance for any enlightenment you can give me.
-- 
View this message in context: http://www.nabble.com/Cannot-retrieve-ActionForward-named...-tp17667182p17667182.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Cannot retrieve ActionForward named...

Posted by JG Flowers <Je...@yahoo.co.uk>.
This is really bizarre.
I'd tried changing the html link to "forward" after initial "action" version
didn't work. Then changed it back, created a war and deployed in Tomcat
again. Suddenly everything works. 
I'm wondering if Tomcat had some sort of ghost image of prior deployment
that had exactly same war named miniHr.war. 
My guess is the "work" folder that didn't get purged on redeployment perhaps
and as a consequence first time I deployed the tiles version, the non-tiles
version was still lingering around from the prior deployment..
Darn it!


Antonio Petrelli-3 wrote:
> 
> 2008/6/5 JG Flowers <Je...@yahoo.co.uk>:
>> 1) Tiles PMC member? What does PMC stand for? A contributor to Tiles or
>> is
>> PMC some kind of Tiles spin off?
> 
> PMC=Project Management Committee. I am both a committer and I have the
> power to decide the future of Tiles (yeah I've got the power! :-D )
> 
>> 2) I discovered this problem and took a look at the code, and fixed on my
>> side.
>> Hopefully you won't have to do it many times, but sometimes it helps.
>> Uh?
>> Should my code have worked then?
>> Is there a bug in Tiles/Struts integration then?
> 
> Possibly it's a bug, though I did not try to find out.
> 
>>  If you've fixed this how can I get latest build?
> 
> I don't think it's fixed. However you can check the latest version
> checking out the Subversion repository:
> http://svn.apache.org/repos/asf/struts/struts1/trunk/
> Anyway check it in JIRA  if the bug has been already filed:
> https://issues.apache.org/struts/
> If not, file a new bug report and, if you can, post a patch.
> 
> Ciao
> Antonio
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Cannot-retrieve-ActionForward-named...-tp17667182p17670588.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Cannot retrieve ActionForward named...

Posted by Antonio Petrelli <an...@gmail.com>.
2008/6/5 JG Flowers <Je...@yahoo.co.uk>:
> 1) Tiles PMC member? What does PMC stand for? A contributor to Tiles or is
> PMC some kind of Tiles spin off?

PMC=Project Management Committee. I am both a committer and I have the
power to decide the future of Tiles (yeah I've got the power! :-D )

> 2) I discovered this problem and took a look at the code, and fixed on my
> side.
> Hopefully you won't have to do it many times, but sometimes it helps.
> Uh?
> Should my code have worked then?
> Is there a bug in Tiles/Struts integration then?

Possibly it's a bug, though I did not try to find out.

>  If you've fixed this how can I get latest build?

I don't think it's fixed. However you can check the latest version
checking out the Subversion repository:
http://svn.apache.org/repos/asf/struts/struts1/trunk/
Anyway check it in JIRA  if the bug has been already filed:
https://issues.apache.org/struts/
If not, file a new bug report and, if you can, post a patch.

Ciao
Antonio

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


Re: Cannot retrieve ActionForward named...

Posted by JG Flowers <Je...@yahoo.co.uk>.
Hi again Antonio,
1) Tiles PMC member? What does PMC stand for? A contributor to Tiles or is
PMC some kind of Tiles spin off?
2) I discovered this problem and took a look at the code, and fixed on my
side.
Hopefully you won't have to do it many times, but sometimes it helps.
Uh?
Should my code have worked then?
Is there a bug in Tiles/Struts integration then?  If you've fixed this how
can I get latest build?

-- 
View this message in context: http://www.nabble.com/Cannot-retrieve-ActionForward-named...-tp17667182p17669991.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Cannot retrieve ActionForward named...

Posted by Antonio Petrelli <an...@gmail.com>.
2008/6/5 JG Flowers <Je...@yahoo.co.uk>:
> When you were learning all this stuff about Struts, what did you find was to
> best resource?

Eh, I am a Tiles PMC member, so I know a lot about Tiles internals,
not much about Struts.
I discovered this problem and took a look at the code, and fixed on my side.
Hopefully you won't have to do it many times, but sometimes it helps.

Antonio

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


Re: Cannot retrieve ActionForward named...

Posted by JG Flowers <Je...@yahoo.co.uk>.
Many thanks for response.
When you were learning all this stuff about Struts, what did you find was to
best resource?
I've found James book quite good, but I feel I'm not getting to grips with
some of the stuff that goes on in struts-config.xml..
-- 
View this message in context: http://www.nabble.com/Cannot-retrieve-ActionForward-named...-tp17667182p17669249.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Cannot retrieve ActionForward named...

Posted by Antonio Petrelli <an...@gmail.com>.
2008/6/5 JG Flowers <Je...@yahoo.co.uk>:
> When you say "use an action that forwards to a Tiles definition" can you
> elaborate on this a bit more for me.

You have to change this:

<action path="/viewSearch"
      forward="search.page"/>

into:
<action atch="/viewSearch" type="com.jamesholmes.minihr.SearchAction">
  <forward name="success" value="search.page" />
</action>

And, in your SearchAction class, do:
return mapping.findForward("success");

HTH
Antonio

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


Re: Cannot retrieve ActionForward named...

Posted by JG Flowers <Je...@yahoo.co.uk>.
Hi Antonio.
Many thanks for feedback.
When you say "use an action that forwards to a Tiles definition" can you
elaborate on this a bit more for me.
Cheers
-- 
View this message in context: http://www.nabble.com/Cannot-retrieve-ActionForward-named...-tp17667182p17668494.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Cannot retrieve ActionForward named...

Posted by Antonio Petrelli <an...@gmail.com>.
2008/6/5 JG Flowers <Je...@yahoo.co.uk>:
>    <action path="/viewSearch"
>         forward="search.page"/>

Using a Tiles definition as the name of a forward action is not supported.
Use an action that forwards to a Tiles definition, or use a JSP page.

Antonio

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


RE: Single user Login

Posted by Prashant Saraf <ps...@cctc.com>.
Hi Jim,

Thanks for the help.. I did try it before what u said, but things are
going worst when user is login off with session time out or close the
browser, 
If user login again after browser crash or browser close then they have
to wait till session timeout is not done.
 

-----Original Message-----
From: Jim Kiley [mailto:jhkiley@summa-tech.com] 
Sent: Thursday, June 05, 2008 10:37 PM
To: Struts Users Mailing List
Subject: Re: Single user Login

If you want to implement a full-blown security scheme like Spring
Security,
there are ways to do it.  If you don't (and that is understandable),
you're
going to need to track whether or not a given user is already logged in,
at
the application level.

One solution, which is absolutely quick-and-dirty, and undoubtedly NOT a
best practice, would be to stash a Set of userids in the application
scope,
using the ApplicationAware interface, and then compare the user who's
trying
to log in to that set of userids.  The complexity you'll get there is
removing the userid from the application scope when the user's session
times
out or he logs out.

jk

On Thu, Jun 5, 2008 at 12:58 PM, Prashant Saraf <ps...@cctc.com> wrote:

> Does anyone know how to do it?
>
> -----Original Message-----
> From: Prashant Saraf [mailto:psaraf@cctc.com]
> Sent: Thursday, June 05, 2008 7:14 PM
> To: Struts Users Mailing List
> Subject: RE: Single user Login
>
> Hi ,
>  I am managing it by DB check. My Helper class is checking either user
> is valid or not with DB.
>
> Regards
> PS.
>
>
> -----Original Message-----
> From: Jim Kiley [mailto:jhkiley@summa-tech.com]
> Sent: Thursday, June 05, 2008 7:10 PM
> To: Struts Users Mailing List
> Subject: Re: Single user Login
>
> This really depends on how you are currently managing authentication.
> How
> are you currently managing authentication?
>
> On Thu, Jun 5, 2008 at 9:33 AM, Prashant Saraf <ps...@cctc.com>
wrote:
>
> > Hi,
> >
> > I want to know how to do single user login, that is user should not
> > login form multiple location at the same time.
> >
> > Regards,
> >
> > Prashant Saraf
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com

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


Re: Single user Login

Posted by Jim Kiley <jh...@summa-tech.com>.
If you want to implement a full-blown security scheme like Spring Security,
there are ways to do it.  If you don't (and that is understandable), you're
going to need to track whether or not a given user is already logged in, at
the application level.

One solution, which is absolutely quick-and-dirty, and undoubtedly NOT a
best practice, would be to stash a Set of userids in the application scope,
using the ApplicationAware interface, and then compare the user who's trying
to log in to that set of userids.  The complexity you'll get there is
removing the userid from the application scope when the user's session times
out or he logs out.

jk

On Thu, Jun 5, 2008 at 12:58 PM, Prashant Saraf <ps...@cctc.com> wrote:

> Does anyone know how to do it?
>
> -----Original Message-----
> From: Prashant Saraf [mailto:psaraf@cctc.com]
> Sent: Thursday, June 05, 2008 7:14 PM
> To: Struts Users Mailing List
> Subject: RE: Single user Login
>
> Hi ,
>  I am managing it by DB check. My Helper class is checking either user
> is valid or not with DB.
>
> Regards
> PS.
>
>
> -----Original Message-----
> From: Jim Kiley [mailto:jhkiley@summa-tech.com]
> Sent: Thursday, June 05, 2008 7:10 PM
> To: Struts Users Mailing List
> Subject: Re: Single user Login
>
> This really depends on how you are currently managing authentication.
> How
> are you currently managing authentication?
>
> On Thu, Jun 5, 2008 at 9:33 AM, Prashant Saraf <ps...@cctc.com> wrote:
>
> > Hi,
> >
> > I want to know how to do single user login, that is user should not
> > login form multiple location at the same time.
> >
> > Regards,
> >
> > Prashant Saraf
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com

RE: Single user Login

Posted by Prashant Saraf <ps...@cctc.com>.
Does anyone know how to do it?

-----Original Message-----
From: Prashant Saraf [mailto:psaraf@cctc.com] 
Sent: Thursday, June 05, 2008 7:14 PM
To: Struts Users Mailing List
Subject: RE: Single user Login

Hi ,
 I am managing it by DB check. My Helper class is checking either user
is valid or not with DB.

Regards
PS.


-----Original Message-----
From: Jim Kiley [mailto:jhkiley@summa-tech.com] 
Sent: Thursday, June 05, 2008 7:10 PM
To: Struts Users Mailing List
Subject: Re: Single user Login

This really depends on how you are currently managing authentication.
How
are you currently managing authentication?

On Thu, Jun 5, 2008 at 9:33 AM, Prashant Saraf <ps...@cctc.com> wrote:

> Hi,
>
> I want to know how to do single user login, that is user should not
> login form multiple location at the same time.
>
> Regards,
>
> Prashant Saraf
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com

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

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


RE: Single user Login

Posted by Prashant Saraf <ps...@cctc.com>.
Hi ,
 I am managing it by DB check. My Helper class is checking either user
is valid or not with DB.

Regards
PS.


-----Original Message-----
From: Jim Kiley [mailto:jhkiley@summa-tech.com] 
Sent: Thursday, June 05, 2008 7:10 PM
To: Struts Users Mailing List
Subject: Re: Single user Login

This really depends on how you are currently managing authentication.
How
are you currently managing authentication?

On Thu, Jun 5, 2008 at 9:33 AM, Prashant Saraf <ps...@cctc.com> wrote:

> Hi,
>
> I want to know how to do single user login, that is user should not
> login form multiple location at the same time.
>
> Regards,
>
> Prashant Saraf
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com

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


Re: Single user Login

Posted by Jim Kiley <jh...@summa-tech.com>.
This really depends on how you are currently managing authentication.  How
are you currently managing authentication?

On Thu, Jun 5, 2008 at 9:33 AM, Prashant Saraf <ps...@cctc.com> wrote:

> Hi,
>
> I want to know how to do single user login, that is user should not
> login form multiple location at the same time.
>
> Regards,
>
> Prashant Saraf
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com

Single user Login

Posted by Prashant Saraf <ps...@cctc.com>.
Hi,

I want to know how to do single user login, that is user should not
login form multiple location at the same time. 

Regards,

Prashant Saraf

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


Re: Cannot retrieve ActionForward named...

Posted by JG Flowers <Je...@yahoo.co.uk>.
Because it's probably still the most widely used Web Framework still. So I
figured I'd hit this one first.
I've got books on Struts 2, JSF and Wicket on my bookshelf to read next!

newton.dave wrote:
> 
> --- On Thu, 6/5/08, JG Flowers <Je...@yahoo.co.uk> wrote:
>> I've been trying to learn Struts [...]
> 
> Just out of curiosity, why are you starting with Struts 1 at this point?
> 
> Dave
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Cannot-retrieve-ActionForward-named...-tp17667182p17669578.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Cannot retrieve ActionForward named...

Posted by Dave Newton <ne...@yahoo.com>.
--- On Thu, 6/5/08, JG Flowers <Je...@yahoo.co.uk> wrote:
> I've been trying to learn Struts [...]

Just out of curiosity, why are you starting with Struts 1 at this point?

Dave


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