• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tiles - Forward problem  RSS feed

 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
  • 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
 
Tad Dicks
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!