This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes how to validate HTML element in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to validate HTML element in Struts" Watch "how to validate HTML element in Struts" New topic
Author

how to validate HTML element in Struts

Rajeev roushan sharma
Ranch Hand

Joined: Jan 28, 2010
Posts: 50
hi!

I am not sure what i am asking is possible or not. Can i validate a HTML element in struts(I am not using struts Tag like <html:text>)? I am using plain HTML tag <input type="text">. Let me know if i am not clear.

Thanks in advance!
Rajeev roushan sharma
Ranch Hand

Joined: Jan 28, 2010
Posts: 50
or i want to know whether it is needed to use STRUTS TAG, if i want to used validation feature of struts. or it can validate plain HTML element ?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Server-side validation is based solely on the parameters received by the server--the server side doesn't know if they're coming from an input tag, a request from a non-browser client, or anything else. If you want to display validation *messages* without Struts tags, you'll have to do it manually.
Rajeev roushan sharma
Ranch Hand

Joined: Jan 28, 2010
Posts: 50
David Newton wrote:Server-side validation is based solely on the parameters received by the server--the server side doesn't know if they're coming from an input tag, a request from a non-browser client, or anything else. If you want to display validation *messages* without Struts tags, you'll have to do it manually.


Thanks David :)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to validate HTML element in Struts
 
Similar Threads
Can i Use my action to throw error
Validator Framework and Javascript
body-content possible values
How am I suppose to validate a refractored class?
Internal page link