Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference in <html:link> and <html:submit>

 
Shahnawaz Shakil
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having 4 jsp pages named login.jsp, redirecting.jsp, resultIE.jsp and resultSafari.jsp Also i have an Action method processLogin(). In the login page, user should enter username and password and press the submit button <html:submit>. On submitting the button the processLogin() method is executed and if user name and password is correct then it is going to redirecting.jsp. The redirecting.jsp is having javascript to detect the browser from which the request is comming. If the request is comming from Internet Explorer, it should redirect it to resultIE.jsp and if it is coming from Safari browser it should redirect it to resultSafari.jsp. This is working fine when i am using <html:submit> but when i am using <html:link> tag then it is not working. Please help me why html:link is not working in this situation?
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shahnawaz,
html:link is altogether different from html:submit, former is for referencing other links/resources from page and later is for submitting a html:form. html:link is get parsed or converted as <a href="".. />, ultimately..

Look what Struts says about html:link !

Now, though you can call an action using html:link, but this is not the true use of it, Why do you want a login page submitted by html:submit, really not a good practice.
 
Shahnawaz Shakil
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sagar,
Thanks for the reply.
I want to use <html:link> because the button is not looking good on my present page. As i said earlier my redirecting.jsp page is having javascript to detect the browser. Strangely when i am removing the javasript from that page and make it a simple hello world page, then i am able to get that page using <html:link>. Please advice.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure how anybody could help much without seeing the code.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shahnawaz Shakil wrote:I want to use <html:link> because the button is not looking good on my present page.

Then use CSS, that's decorate your button the way you want, googling provides you the plenty of hits regarding how to do that. And about rest of your doubt I don't get it, Follow what David suggested.
 
Shahnawaz Shakil
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sagar and David for your help. I am using <html:submit> now instead of <html:link>. Can't give the code here as its very long. But thanks you all for your help.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shahnawaz Shakil wrote:Can't give the code here as its very long.

Then, IsolateTheProblem
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic