• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

A html:link problem

 
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, there:

I want to use hyper link instead of submit button in my form to submit it. And this is what I did:



it gives me:
10:44:44.376 WARN!! Exception for /euwi/pages/login.jsp
org.apache.jasper.JasperException: /pages/login.jsp(150,49) Attribute onClick invalid according to the specified TLD
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:428)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:186)

However, if I using <html:submit/> instead, everything works fine. Anything wrong I did?

Highly appreciated if any suggestion or comments from you.
Thanks a lot in advance

David
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try to use lower case
"onclick"

--Nimchi
 
David Chen
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much Nimchi for immediately reply. It's exactly the problem. I'm so stupid to use capital 'C'. Thanks a lot again.
However, by using hyperlink instead of html:submit, now I have the problem to populate form fields.

It seems not populate the form fields at all, in myAction class I checked actionForm, all fields are null.
However, if using <html:submit /> instead, all form fields are sent correctly without any problem.
can you Nimchi, or anyone help me on that?

Thanks a lot again for your help

David
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to use the standard html Anchor tag. the problem is the rendered html:link tag has an action, so it will automatically be a link to that action.
 
David Chen
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much Kerry for your reply. You are right, and the same as the suggestion from Ram in another thread:
both:
<a href="javascript:submitIt()">SUBMIT</a>
or
<html:link href="javascript:submitIt()">SUBMIT<html:link>
will work in my case. However it will not populate form fields if using:
<html:link action="login" onklick="javascript: submitIt()">SUBMIT</html:link>
the reason is just as you said. Thanks a lot again.

David
 
Eat that pie! EAT IT! Now read this tiny ad. READ IT!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic