Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

struts forward link?

 
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have tried finding an answer but I cna't seem to locate a simple code example of how to do what should be a simple thing (Still learning struts)

I want to do this

Do you still just do links the same way or is there a 'struts way' of doing this? If so, how?

Thanks
 
Pat Peg
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found an example here...
http://publib.boulder.ibm.com/infocenter/rtnlhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.struts.doc/topics/cstrdoc006.html

and I am trying to implemet. What is the difference between a local and global forward? When would I use what?

In this part of the example....

what is the "bean:message key="mainMenu.logoff"/" part doing?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the differences between a global forward and a local forward is that you can't use a local forward in an <html:link> tag. You must use a global forward. The main difference, though, is that a global forward can be used in an Action class, whereas a local forward can be used only in the Action class for which the forward is defined.

As for the <bean:message> tag: here is a link to the documentation for the <bean> tags.
 
Pat Peg
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the link. I am trying to digest it but I think I am only confusing myself.

I learn best from examples, is there a simple code example somewhere that does just this one function? It seams like in the entire crawl-walk-run learning cycle struts has a few crawl, more run but almost no walk. It is very frustrating.
 
Pat Peg
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the code I have so far but it isn't working...

I am not sure what I am doing wrong. I did not put a bean in because I am not sure that I need one-I don't know if that is allowed

Also, on my pageforward class, I couldn't think of a fail case so I am not sure if what I did there was correct or not.

Any insight would be appreciated.

Thanks
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pat,

I'm going to suggest a change in approach here. Rather than struggling through creating your own application without any guidelines, I'd suggest you lay this project aside for a while, and do one of the many good Struts tutorials that are out there. These will walk you step-by-step through the process of creating and testing a Struts application. Once you have done one or two of these, I think you'll be much more ready to tackle your own application.

Here are some links to a few good Struts tutorials:

http://javaboutique.internet.com/tutorials/Struts/

http://wiki.apache.org/struts/StrutsTutorials
 
Oh sure, it's a tiny ad, but under the right circumstances, it gets bigger.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic