Binding an ActionBean to "/" ?

View: New views
3 Messages — Rating Filter:   Alert me  

Binding an ActionBean to "/" ?

by John W Newman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,

 

I’m a big fan of the pre-action navigation scheme, it’s pretty solid.  User goes to action bean > forward to jsp > post to bean > redirect to another bean

 

What I’d like to do is bind an action bean to the web app root.  Currently I have index.html there, which does a javascript redirect to some action bean (blah).  What I’m wondering is if it’s possible to go to this bean directly instead.  I tried

 

 

@UrlBinding("/”)

public class ListRequests extends SecureActionBean<SchedulingActionBeanContext> {

 

}

 

But the stripes dispatcher is mapped as

 

      <servlet-mapping>

            <servlet-name>StripesDispatcher</servlet-name>

            <url-pattern>*.action</url-pattern>

      </servlet-mapping>

 

I tried adding another mapping to

 

      <servlet-mapping>

            <servlet-name>StripesDispatcher</servlet-name>

            <url-pattern>/</url-pattern>

      </servlet-mapping>

 

And it worked pretty well but that caused everything to be routed through the dispatcher (css files, etc) so no dice.  Any ideas? 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Stripes-users mailing list
Stripes-users@...
https://lists.sourceforge.net/lists/listinfo/stripes-users

Re: Binding an ActionBean to "/" ?

by Morten Matras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Here a way:

In web.xml add a welcome-file:

 <welcome-file-list>
        <welcome-file>page/Show.action</welcome-file>
    </welcome-file-list>

This welcome-file goes to the ActionBean on page/Show.action.

For this to work in tomcat you also need to add a file with the name Show.action in the page folder. This can be empty or containing dummy text it is never read.

Regards

Morten Andersen
www.blobcom.com


2007/3/20, Newman, John W <newmanjw@...>:

Hi,

 

I'm a big fan of the pre-action navigation scheme, it's pretty solid.  User goes to action bean > forward to jsp > post to bean > redirect to another bean

 

What I'd like to do is bind an action bean to the web app root.  Currently I have index.html there, which does a javascript redirect to some action bean (blah).  What I'm wondering is if it's possible to go to this bean directly instead.  I tried

 

 

@ UrlBinding( "/")

public class ListRequests extends SecureActionBean<SchedulingActionBeanContext> {

 

}

 

But the stripes dispatcher is mapped as

 

      < servlet-mapping >

            <servlet-name >StripesDispatcher </servlet-name >

            <url-pattern >*.action </url-pattern >

      </ servlet-mapping >

 

I tried adding another mapping to

 

      < servlet-mapping >

            <servlet-name >StripesDispatcher </servlet-name >

            <url-pattern >/</ url-pattern >

      </ servlet-mapping >

 

And it worked pretty well but that caused everything to be routed through the dispatcher (css files, etc) so no dice.  Any ideas? 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Stripes-users mailing list
Stripes-users@...
https://lists.sourceforge.net/lists/listinfo/stripes-users




--
  Morten Andersen
  Direktør
  Blob Communication ApS
  Svendsagervej 42
  5240 Odense NØ

  T: 76 654321
  W: www.blobcom.com
  E: morten@...
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Stripes-users mailing list
Stripes-users@...
https://lists.sourceforge.net/lists/listinfo/stripes-users

Re: Binding an ActionBean to "/" ?

by John W Newman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Morten,

 

Thanks a bunch for the clever trick - that worked perfectly.  I’ve needed to do that for a long time on 5 or 6 apps but couldn’t figure it out.  This is sweet

 

 

 


From: stripes-users-bounces@... [mailto:stripes-users-bounces@...] On Behalf Of Morten Andersen
Sent: Tuesday, March 20, 2007 11:32 AM
To: Stripes Users List
Subject: Re: [Stripes-users] Binding an ActionBean to "/" ?

 

Here a way:

In web.xml add a welcome-file:

 <welcome-file-list>
        <welcome-file>page/Show.action</welcome-file>
    </welcome-file-list>

This welcome-file goes to the ActionBean on page/Show.action.

For this to work in tomcat you also need to add a file with the name Show.action in the page folder. This can be empty or containing dummy text it is never read.

Regards

Morten Andersen
www.blobcom.com

2007/3/20, Newman, John W <newmanjw@...>:

Hi,

 

I'm a big fan of the pre-action navigation scheme, it's pretty solid.  User goes to action bean > forward to jsp > post to bean > redirect to another bean

 

What I'd like to do is bind an action bean to the web app root.  Currently I have index.html there, which does a javascript redirect to some action bean (blah).  What I'm wondering is if it's possible to go to this bean directly instead.  I tried

 

 

@ UrlBinding( "/")

public class ListRequests extends SecureActionBean<SchedulingActionBeanContext> {

 

}

 

But the stripes dispatcher is mapped as

 

      < servlet-mapping >

            <servlet-name >StripesDispatcher </servlet-name >

            <url-pattern >*.action </url-pattern >

      </ servlet-mapping >

 

I tried adding another mapping to

 

      < servlet-mapping >

            <servlet-name >StripesDispatcher </servlet-name >

            <url-pattern >/</ url-pattern >

      </ servlet-mapping >

 

And it worked pretty well but that caused everything to be routed through the dispatcher (css files, etc) so no dice.  Any ideas? 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Stripes-users mailing list
Stripes-users@...
https://lists.sourceforge.net/lists/listinfo/stripes-users




--
  Morten Andersen
  Direktør
  Blob Communication ApS
  Svendsagervej 42
  5240 Odense

  T: 76 654321
  W: www.blobcom.com
  E: morten@...


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Stripes-users mailing list
Stripes-users@...
https://lists.sourceforge.net/lists/listinfo/stripes-users