Posts Tagged ‘jsp’

Struts Interview questions – 2

January 7th, 2011 1 comment

Wow another Struts interview test ! I am sure you would have enjoyed the last Struts interview questions test.

Here another tests on struts  to test your concepts and get you ready for the next job interview

Struts interview questions 2

These are the test which have questions designed to test your concepts as well as practical skills. for eg questions like

You have 3 List objects in Action class attributes  colorList
[“Red”, “Yellow”, “Green”]
codeList [“R”, “Y”, “G”] statusList [“Failed”, “Severe”, “Good”]
What will be the output of the following code?
<s:merge var=”myMergedIterator”>      <s:param value=”%{colorList}” />
<s:param value=”%{codeList}” />      <s:param value=”%{statusList}” />
</s:merge> <s:iterator value=”%{#myMergedIterator}”>
<s:property /> </s:iterator>
another question
You are asked to change the current feature of displaying the report
result in HTML table to a downloadable Excel format with a default file name as “Y2008.xls”.
Which of the following is correct way to implement the same?

These kinds of questions on struts framework cannot be answered by a person who has not worked with Struts.  So take the test and give us your feedback.

Categories: Interview questions Tags: ,

JSP Interview Questions

December 10th, 2010 1 comment

JavaServer Pages (JSP) technology provides a simplified, fast way to create dynamic web content. JSP is still one of the most popular web technologies.

Java Servlet technology provides Web developers with a simple, consistent mechanism for extending the functionality of a Web server and for accessing existing business systems.

Together JSP and servlets are an integral component of any web application .

This is free JSP and Servlet interview question test to check your knowledge and help you prepare for interview.

This another Servlet and JSP Interview questions test and also has question on JSTL (JavaServer Pages Standard Tag Library)

Categories: Interview questions Tags: ,

Struts Interview questions – 1

November 21st, 2010 No comments

Apache Struts had been on eof the most popular open source frameworks in early 2000.  It is still very widely used and has seen some major enhancements with Struts 2. Here we have 2 new tests on struts  to test your concepts and get you ready for the next hot shot job.

Struts interview questions 1

These are the test which have questions designed to test your concepts as well as practical skills. for eg questions like

You have created a action class called TakeTestAction to dispatch to takeTest.jsp and have configured in struts.xml. The class has only one method named perform() and does not have execute() method.

Which of the following is true?

Another one

You have written a Action class with multiple methods create(), update() and delete().  But, you are asked to configure 3 distinct actions in struts.xml. Which of the following is the best way to implement?

These kinds of questions on struts framework cannot be answered by a person who has not worked with Struts. So this tests will test your knowledge and skills.

Categories: Interview questions Tags: ,

IE7 ignores table width

August 23rd, 2010 3 comments

There has been a problem in using table width in IE7.

The pre tags in IE 7 do wrap the text but the table width will remain wider and scrollbar appears, as if the text is taking full space. This problem doesn’t come in Firefox and Chrome. Can anyone help me out defining proper style for IE 7 for pre tags. for eg of you look at this code

 <style type="text/css">

pre {
width: 600px;
 white-space: pre-wrap;       /* css-3 */
 white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
 white-space: -pre-wrap;      /* Opera 4-6 */
 white-space: -o-pre-wrap;    /* Opera 7 */
 word-wrap: break-word;       /* Internet Explorer 5.5+ */
 display: block;
<table width="70%" border="1">
 <tr> <td width="100%">
<pre> This is sample long text only to test IE 7 table width and it should be wrapping around but that does not happen . So we will have to find a solution </pte>
</td> </tr> </table>

You would not face this problem in Firefox or IE8.  It only happens with IE.

Solution : Use  table-layout: fixed;

If you apply the table-layout:fixed style for the inner table, where the data is in different columns, all columns get same area irrespective of their defined width.  But if applied it to the outer table, and it works fine.

Categories: Programming / tutorials Tags: , ,

SEO friendly URL in JSP/JSF applications

May 31st, 2010 No comments

While I had been working in j2ee enterprise application, the SEO friendly url’s was never an objective. It was never required that each page should have a unique bookmarkable url.

But things change completely in world wide web world. SEO is hot . All the pages should have a unique user friendly url.

In Skill-Guru although we had unique url for the test pages, they were never user friendly. Our url’s were like

So we took the project of re architecting the application to have a clean , user friendly , bookmarkable url.  We looked at couple of options like url rewriting in .htaccess file on the server.

Then we discovered pretty faces.  Pretty faces utility has been written by Lincoln Baxter. This makes life so much easier for application developer . It also left the control with the developer to manage the url within the application instead of managing on server.

I am not going into details of pretty faces as Lincoln has done an excellent job on documentation. Now the url’s in our application are user freindly.

Thanks to pretty faces we now have pretty URL’s.

Load testing using Apache JMeter

May 25th, 2010 6 comments

JMeter is a desktop application used to load test functional behavior and measure performance. It is used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more).

JMeter supports HTTP, HTTPS, FTP, SOAP, POP3, JDBC, thus enabling its use to test most of the applications. It has record and playback capability which enables easy test case creation. But, it can directly record only HTTP requests and supports HTTPS spoofing which is not completely reliable.

Steps to setup JMeter and create test plan :-

  1. Download the latest version of JMeter from the website
  2. Run the batch file in JMeter folder -> bin -> jmeter.bat

Below is the snap shot of the Apache JMeter Tool.

Apace Jmeter Read more…

Categories: Programming / tutorials Tags: , ,

JSF 2 – New features

May 20th, 2010 1 comment

In our last post , Getting started with JSF , we had covered JSF1.2.  JSF has come a long way from that.  JSF 2 has come with very new features, some of them taken from different frameworks / components.  Now JSF developers don’t have to look out. JSF2 helps JSF developers to keep their application simple.
There are many articles explaining new features of jsf 2. But here in this blog, I brief you some of the features:

1. The introduction of  View scopes, flash scope and custom scope – View scopes,Flash scopes and custom scopes are ‘bigger than request scope but smaller than session scope’. Many times developers are forced to keep objects in session scope just because they want the objects available till end of their front view operation or make them work in the redirection or till end of their front end operation.  For example you might have experienced implementing edit/delete/ add operations to datatable,  many times its necessary to make the bean session scope to make it working right way. This can be avoided by view scope variables. The custom scope helps objects to be available till end of user operation (user has to decide the scope of bean). This is like flow scope.Flow scopes were offered by frameworks like spring webflow etc .. But for an application already done in JSF, it is easier to shift to JSF2 than webflow.
Read more…

Categories: Programming / tutorials Tags: , ,

How important are sitemaps for dynamic websites

May 18th, 2010 No comments

This question has come up again time and again if sitemaps are really important and do they help in boosting up your rankings. I am not sure how will it affect your rankings but a sitemap does help search engine to crawl your site and understand all the links. Some SEO’s do claim that sitemaps do help in boosting your rankings.

If your site is dynamic website and has new contents being churned out frequently , sitemaps are really important.

Quoting google webmaster

Sitemaps are particularly helpful if:

  • Your site has dynamic content.
  • Your site has pages that aren’t easily discovered by Googlebot during the crawl process – for example, pages featuring rich AJAX or Flash.
  • Your site is new and has few links to it. (Googlebot crawls the web by following links from one page to another, so if your site isn’t well linked, it may be hard for us to discover it.)
  • Your site has a large archive of content pages that are not well linked to each other, or are not linked at all.

I will give one example of sitemaps in dynamic websites. Sites like  Stackoverflow have a sitemap.xml file is created which contains a link to every question posted on the system. When a new question is posted, they simply append another entry to the end of the sitemap file. Read more…

Categories: Programming / tutorials Tags: , ,