Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Struts Interview Questions and Answers

Test your skills through the online practice test: Struts Quiz Online Practice Test

Related differences

Related differences

Struts vs JSFStruts vs SpringStruts 1 vs Struts 2
Struts 1.1 vs Struts 1.2Struts 1.2 vs Struts 1.3

Ques 41. How can I scroll through list of pages like the search results in google?

Many Struts developers use the Pager from the JSPTags site.
http://jsptags.com/tags/navigation/pager/

Is it helpful? Add Comment View Comments
 

Ques 42. Why do the Struts tags provide for so little formatting?

The Struts tags seem to provide only the most rudimentary functionality. Why is there not better support for date formatting and advanced string handling?
Three reasons:
First, work started on the JSTL and we didn't want to duplicate the effort.
Second, work started on Java Server Faces, and we didn't want to duplicate that effort either.
Third, in a Model 2 application, most of the formatting can be handled in the ActionForms (or in the business tier), so all the tag has to do is spit out a string. This leads to better reuse since the same "how to format" code does not need to be repeated in every instance. You can "say it once" in a JavaBean and be done with it. Why don't the Struts taglibs offer more layout options?
Since the Struts tags are open source, you can extend them to provide whatever additional formatting you may need. If you are interested in a pre-written taglib that offers more layout options, see the struts-layout taglib.
In the same arena, there is a well regarded contributor taglib that can help you create Menus for your Struts applications.

Is it helpful? Add Comment View Comments
 

Ques 43. Why does the <html:link> tag URL-encode javascript and mailto links?

The <html:link> tag is not intended for use with client-side references like those used to launch Javascripts or email clients. The purpose of link tag is to interject the context (or module) path into the URI so that your server-side links are not dependent on your context (or module) name. It also encodes the link, as needed, to maintain the client's session on the server. Neither feature applies to client-side links, so there is no reason to use the <html:link> tag. Simply markup the client-side links using the standard tag.

Is it helpful? Add Comment View Comments
 

Ques 44. Why does the option tag render selected=selected instead of just selected?

Attribute minimization (that is, specifying an attribute with no value) is a place where HTML violates standard XML syntax rules. This matters a lot for people writing to browsers that support XHTML, where doing so makes the page invalid. It's much better for Struts to use the expanded syntax, which works the same on existing browsers interpreting HTML, and newer browsers that expect XHTML-compliant syntax. Struts is following the behavior recommended by the XHTML specification.

<select id="item" name="item" selected="selected">
<option value="option1">Option1</option>
<option value="option2">Option2</option>
</select>

Is it helpful? Add Comment View Comments
 

Ques 45. Do I have to use JSPs with my application?

The short answer to this question is: No, you are not limited to JavaServer Pages.
The longer answer is that you can use any type of presentation technology which can be returned by a web server or Java container. The list includes but is not limited to:
* JavaServer Pages,
* HTML pages,
* WML files,
* Java servlets,
* Velocity templates, and
* XML/XLST
Some people even mix and match apparently unrelated technologies, like PHP, into the same web application.

Is it helpful? Add Comment View Comments
 

Most helpful rated by users:

©2024 WithoutBook