This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes I had these two jsp interview questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "I had these two jsp interview questions " Watch "I had these two jsp interview questions " New topic
Author

I had these two jsp interview questions

majid nakit
Ranch Hand

Joined: Jun 26, 2001
Posts: 164
Hi,
I had an interview yesterday and they give me this question, I could not find a solution :

1)Question1:

The following code loops through a collection of HighlightEntities and writes out a list. If there are no highlights then it should write out “No highlights,” but it is possible for the page to display neither highlights nor the “No highlights” message, but not cause an error. Why?



2)Question2:

A filter sets an attribute, “newsList”, on the request before this file is served. “newsList” is an arrayList of NewsEntity objects. The result should be an XML listing of NewsEntities.

What is wrong with this JSTL code?




thanks, your help is appreciated.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

hint:you have done the null check(list==null). well, there is also one more check called *empty check* .
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

majid nakit wrote:
What is wrong with this JSTL code?

what is your opinion? and please start a new thread/topic for a new question.
Hosea Kandie
Greenhorn

Joined: Jul 14, 2011
Posts: 1

Look at this and try to use
http://www.coderanch.com/t/412438/java/java/if-isEmpty-or-null

  • The list is completely empty
    The list does not exist.


  • Try checking if isEmpty instead of using null
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: I had these two jsp interview questions
     
    Similar Threads
    Not able to retrieve the request attribute that was set using c:set tag.
    Implementation of google charts in JSP
    ajax and servlet problem
    JSTL: remove object from scope
    Doubt on scriptlet and c:set