• 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

Struts2 concepts doubts

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have some doubts in Struts2.1. Please clarify...

1. Can annotation validations be performed in Struts2.1.


2. How do I specify in Actionclass-validation.xml file that a numeric field cannot accept alphabets.
Is this the correct validator
<field-validator type="conversion"> in validation.xml


3. We need to specify <result name="input">Login.jsp</result> , so that if there are any valiation errors this input jsp page will be displayed.
But
What is the use of <result name="error">/tutorial/error.jsp</result> in struts.xml.

4. Do we have to place Actionclass-Validation.xml file in WEB-INF-> classes folder only

5. Is this tag mandatory to perform AJAX validation
<s:url id="url" namespace="/validation" action="quizAjax"/>

6. Must we specify <s:fielderror/> in JSP for field validators and <s:actionerror/> in JSP for non field validators.Is this mandatory.

7. Please suggest a good website with some examples for learning testing struts2 Actions ,Interceptors using JUnit

8. How do we debug a struts2 application in Eclipse.

 
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
>> 1. Can annotation validations be performed in Struts2.1.

Yes; did something lead you to believe they couldn't?

>> 2. How do I specify in Actionclass-validation.xml file that a numeric field cannot accept alphabets. Is this the correct validator <field-validator type="conversion"> in validation.xml

Normally you wouldn't need to, just use an int validator, but what precisely to do depends on your requirements and the type of the backing property (int and Integer behave differently).

>> What is the use of <result name="error">/tutorial/error.jsp</result> in struts.xml.

What do you mean "what is the use of"? It's a mapping for a result named "error" that uses a specific page--I have no idea what it's for beyond that--whoever wrote it probably knows, though.

>> 4. Do we have to place Actionclass-Validation.xml file in WEB-INF-> classes folder only

Yes. I'm sure it would be easy to hack in support for something else, but I don't know why you'd want to.

>> 5. Is this tag mandatory to perform AJAX validation
>> <s:url id="url" namespace="/validation" action="quizAjax"/>

What do you mean?

>> 6. Must we specify <s:fielderror/> in JSP for field validators and <s:actionerror/> in JSP for non field validators.Is this mandatory.

No, it's not mandatory; the just display a list of field or action errors.

>> 7. Please suggest a good website with some examples for learning testing struts2 Actions ,Interceptors using JUnit

The Struts 2 wiki?

>> 8. How do we debug a struts2 application in Eclipse.

Same as any other web application.
 
p hasini
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for taking time and answering all my questions.


1. I didnt understand the purpose of this tag
<s:url id="url" namespace="/validation" action="quizAjax"/>

2. How do we debug a struts2 application.I do not really know how to debug an application.

 
David Newton
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

p hasini wrote:1. I didnt understand the purpose of this tag
<s:url id="url" namespace="/validation" action="quizAjax"/>


It just creates a URL that can be used in-place, or referenced later.

2. How do we debug a struts2 application.I do not really know how to debug an application.


Depends on your setup, but in general you should just be able to set breakpoints like any other application.
 
It's feeding time! Give me the food you were going to give to this tiny ad:
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