• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tiles - Forward problem

 
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, good day , i having a problem in forward..and my application layout using tiles

my application have following navigation link in nav.jsp:


when i click on Customer Maintenance System, there have a form say "form A" which will fire "action = /actions/forma.do", the action class have process fine ...but since i want the application after the user click submit button in "form A" will simply return back to original page which is "Form A" after complete the action ,

so i make the forwards = /index.jsp (customer maintenance system index page) ..but somehow, when i click on customer maintenance system link again , it now make the link URL as "localhost/myapp/actions/index.jsp" but not "localhost/myapp/index.jsp" ..

anyone can guide me how to solve this problem ? thank you very much
 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Um, inside your struts-config file do you have teh actions defined?

It looks like your using regular old html links/anchor tags (<a> . You should be using the <html:link action="youractionhere"> text</html:link> tags.

It's considered bad practice to make direct links between pages in your application.

inside of your struts-config file in the <action-mappings> section you would have something like:
<action path="/youractionhere" type="org.apache.struts.actionForwardAction" parameter="yournew.page"/>


hope that helps

-Tad
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, Tad, i found using struts predefine tag like <html:link> always get problem with javascript or css ..so i stick with normal html tag ...thanks for your advice anyway ...i try to change it , between , how you learn struts .can you recommend a good book for struts ...once again, thank you very much for help
 
Tad Dicks
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
all the struts <html:xxx> tags end up getting rendered as normal html tags (just do a veiw source on the actual page in a browser). I've not noticed any problems with css or javascript yet. I try to put most of the css info in div tags and use those around whatever strut tags I'm using.

something like
.myclass A:link
{
...
}

and then
<div class='myclass'><html:link ....</html:link></div>

should style the link (or at least thats been my experience).


I've been/am learning struts using a book... its one of those red wrox books "programmer to programmer" can't recall the exact title and its at home =/

-Tad
 
reply
    Bookmark Topic Watch Topic
  • New Topic