File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Sample pgm

 
kathir vel
Ranch Hand
Posts: 92
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marc and Christophe,
I just included <html:errors/> in form.jsp.Is it enough to see the errors?
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kathir,
Could you please stop making new threads for this problem (second time). Please continue in this thread. I have closed the other one.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  • 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
    Posts: 92
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Pie
    Posts: 14691
    16
    Eclipse IDE Ubuntu VI Editor
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 92
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    OK.Html Taglib is for struts.SQL and XML taglibs is for JSTL in JSP.Thanks for your replies.
     
    Marc Peabody
    pie sneak
    Sheriff
    Posts: 4727
    Mac Ruby VI Editor
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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!
     
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic