• 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

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

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure how anybody could help much without seeing the code.
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Shahnawaz Shakil wrote:Can't give the code here as its very long.


Then, IsolateTheProblem
 
Hey! You're stepping on my hand! Help me tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic