This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Struts Sample pgm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Struts Sample pgm" Watch "Struts Sample pgm" New topic
Author

Struts Sample pgm

kathir vel
Ranch Hand

Joined: Jul 03, 2007
Posts: 92
Hi Marc and Christophe,
I just included <html:errors/> in form.jsp.Is it enough to see the errors?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

kathir,
Could you please stop making new threads for this problem (second time). Please continue in this thread. I have closed the other one.


[My Blog]
All roads lead to JavaRanch
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

  • Put the struts-taglib-1.3.8.jar in your WEB-INF/lib directory
  • Add the following directive in form.jsp
  • Add the <html:errors/> tag in the body of form.jsp

  • Directive:


    I think you should have a good understanding of tag libraries before using this. If you don't understand how the html:errors tag works, then you should probably study the chapter on tag libraries again. (if not aleady done)
    kathir vel
    Ranch Hand

    Joined: Jul 03, 2007
    Posts: 92
    Sorry for the new posts.I thought you won't notice my post replies.

    I got it.I got an error in validate method.Now It works.I thank you for your patience and help.
    I think,HFSJ didn't cover Html taglib and SQLtaglib.Where can I refer to study those taglibs?
    Christophe Verré
    Sheriff

    Joined: Nov 24, 2005
    Posts: 14688
        
      16

    HFSJ didn't cover Html taglib and SQLtaglib

    Ye,s it's out of scope for the exam. You can find Struts HTML taglib info at Struts homepage. SQLtaglib ? Do you mean JSTL's sql library ? If so, you'll find some info in the JSTL spec. But don't waste too much time on those for the moment
    kathir vel
    Ranch Hand

    Joined: Jul 03, 2007
    Posts: 92
    OK.Html Taglib is for struts.SQL and XML taglibs is for JSTL in JSP.Thanks for your replies.
    Marc Peabody
    pie sneak
    Sheriff

    Joined: Feb 05, 2003
    Posts: 4727

    Originally posted by kathir vel:
    I got it.I got an error in validate method.Now It works.I thank you for your patience and help. [/b]

    Well, the html:errors part works. You still need to figure out why it's failing. In theory, you should never see an error when submitting the form... at least not for this form, because every option in the select dropdown box should be a valid value. Right?

    The main thing to check is what the value of color is in the ActionForm during the validate method. Is it null? Empty string? Is the value something that should be considered valid and the logic isn't working correctly in the validate method?

    This is great experience for learning the basics of Struts. Keep it up!


    A good workman is known by his tools.
     
    GeeCON Prague 2014
     
    subject: Struts Sample pgm