page « JSTL « JSP-Servlet Q&A

1. How do you check the browser's user agent in a JSP page using JSTL, EL?

I need to check the browser's user-agent to see if it is IE6. However I shouldn't use scriptlets (we have a strict no scriptlets policy) to do this. Currently I use


2. Use object's method in a jstl page

I have a model with this method:

public List<String> getPriviledgeNames()
I'm trying to display a list of checkbox in my jstl page, and I'd like to checked only the ones which their name ...

3. JSP page not reading submitted for values

I am working on the front end of a jsp based app. We're using spring running on weblogic. I have a page with a form that submits to itself and I am ...

4. show notification in jsp page depending on a flag?

I have HTML code in the jsp page that I want it to be displayed only after the user submits data and get redirected to this page. So I have to ...

5. how to transfer value from one jsp page to second jsp page

i have one value called titleValue at one jsp page called titleValue..i need to show this value at second jsp page.. could you please tell me how to show this ...

6. Custom JSP page

Based on the user session I have to display different stuff on JSP. Something is wrong, please advice

  <c:if test="${session.getAttribute("userEmail")}">


7. Setting default fmt formatNumber maxFractionDigits for all jsp pages

Is it possible to have the following tag always display 5 decimal places?

<fmt:formatNumber type="currency" value="${number}" />
without having to change it to
<fmt:formatNumber type="currency" maxFractionDigits="5" value="${number}" />
basically I have so many of these ...

8. How to show a collection in a jsp page

My servlet class and jsp is given below.

  public class ContactManager extends HttpServlet {
List<ContactDetails> contactsList = new ArrayList<ContactDetails>();

public List<ContactDetails> getContactsList() {
    return contactsList;

public void setContactsList(List<ContactDetails> contactsList) {

9. How to get page name in JSP or JSTL?

I want to get current page name (something like "myPage") using JSP or JSTL. How can I achieve this?

10. fn:length is undefined on all my pages now, jstl

For some reason I am getting the error below now when I do a maven install in the target folder. Why would this error happen? The function fn:length is ...

11. How can I work with Iterables in my JSP pages?

I'm using an API that makes heavy use of Iterables (java.lang.Iterable), but I can't use them directly on my JSP pages because JSTL tags and EL can not process them. Right ...

12. Iterating over a List on JSP page does not work

I've been struggling to find the problem in my code and I just don't see it. In my servlet, I create a list of countries and set it into my request:

List<Country> countryList ...

13. IE 7 not shows the data on jsp page

I have list of the objects.that i am display using the jstl (for:each tag),the tag is generates the data but it not shown on the jsp page.I checked the same thing ...

14. add search capabilities and support for pages to a web application

I was wondering if there are any open source plugins or tutorials for adding search capabilities to a web application (to search my content only) and for adding support for pages ...

15. How to design/develop a JSP page which has to show 15 profile pics with their names in it?

I have a JSP page, which is used to show 15 profile pics with their names. Similar to Orkut Friend List. I am bringing information(friends list) from DB and showing it ...

16. JSP Portlet Problem with JSTL Used JSP pages

Hi I am using the Liferay Portlet with Tomcat 5.5. I created the JSP Portlets to be viewed in the Portal. Normal JSP codes that is not giving a problem but while including the JSP pages with the Tag Libraries used I am not able to include that page into the Portlet. Even that page is working fine as a separate ...

17. JSTL errors causes page to half-load

Every so often, I have an error in the JSTL I write for my JSP's, such as a typo. This causes the page to not render properly. It's as if the browser decided to quit halfway (or even less). I don't see any meaningful error messages or any exception, just a half-rendered page. Is this behaviour normal? It's a real pain ...

18. How to run simple JSTL page?

You don't need a book, just the JSTL Specification. So you say that the EL works outside of the tag? If so, your web app is correctly configured. OK, now put the tag back in and see what's being sent to the browser with a View Source. If the tag is still there, that means that the JSTL ...

19. How can i get session value in my JSP page using JSTL

Hi Friends, i am new to java and i have assigned a task that i need to get value from Session value using JSTL. I know how to get session values using java script let. But i don't know how to get session value using JSTL. I gone through some examples and followed as it is. But its not getting value ...

22. Multiple Language in my web page

<% String langChoice = request.getParameter( "lang" ); if ( langChoice == null ) session.setAttribute( "langPref", session.getValue("langPref") ); else if ( langChoice.equals("fr") && session.getValue("langPref") == "eng" ) session.setAttribute( "langPref", langChoice ); else if ( langChoice.equals("eng") && session.getValue("langPref") == "fr" ) session.setAttribute( "langPref", langChoice ); else if ( langChoice.equals("fr") ) session.setAttribute( "langPref", "fr" ); else session.setAttribute( "langPref", "eng" ); %>

23. Java Server Pages

25. how to reload a jsp page

26. to retrieve multiple values from html page through jsp

hi all, I have a problem while retrieving the values in jsp.In the html page I kept the set of values to be submited in a loop.But while retrieving I am able to retrieve only one set of values.I want to retrieve all the set of values submited in a loop. In Html I have written the code like this: <% ...

28. java server pages

30. Display the contents of a file on jsp page

This is my code, i just want to read the file log1.txt and display the contents of file on the jsp page. When i execute it i found the jsp page with no output display. i find no errors. please help me to sort out this issue <%@page contentType="text/html" pageEncoding="UTF-8"%> <%! String fileOutput; %> <%@ page import="java.lang.*" import="java.util.Scanner" import="" import="*" %> ...

31. How do I call a class in jsp page

32. what is and how works the first ?,

what about first case ? "details" is it folder or page? if page what ext, .jsp? about second case: i know that may get the param in get [non post] but sometimes whole pages have differ layout ...I do not think to be param, and sometimes whole site's pages are all derived from a signle x page , well?

33. problems when I try to execute a jsp page

34. help in line graph in jsp page

35. How to connect JSP pages to SMS gateway

36. Problem in JSP Page Designing

37. sendRedirect to a a framed page

39. use portlets to call JSP page

40. Problem with Radio Button on JSP page (esp one row data)

Dear JSP/Struts Gurus, I am using some radio buttons at a JSP page and i wanna know which one is clicked (depending on the rows return from my Database -- the numbers of radio buttons with data return is different); so i gotten this line; however, i notice that it can only work only in multiple 'records' return and fails when ...

41. call a pl/sql procedure through a jsp page

42. Page to page navigation

43. Error Page in JSP Having Problems.

45. Sending data trough for to two JSP pages

46. Page Context

48. request flow across the page

51. Displaying the right details of a resource taken from a JSP results page

Displaying the right details of a resource taken from a JSP results page Hi all, I am having a little problem in taking a list of search results that I generate from a JSP page, and when selecting the checkbox I want to view a particular resources result for, displays the wrong information. I can get the first result ...

54. Please help : showing JSP page inner another JSP page

hi all... please help to solve my problem . my project like this : # i have JSP page=> index.JSP , i have divide that into 4 div (1,2,3,4) at the second div , i added submit button . # when submit button pressed , it's would call the servlet .and then servlet forward to another JSP page(output.JSP ).output.JSP have attribute ...

57. automatic update page

Dear all. i am faced the big problem so hard to solve . Currently i am get prices from commodity exchange for each seconds that prices always changes such as: 1st second : Sell,1.32464,6000 2nd second : Sell,1.32463,7000 3rd second ; Sell,1.32462,8000 you see that the prices always changes for each seconds . i want to display sell on web browser ...

59. Getting a null pointer exception when loading my JSP result page

Hi all, I am working on an EJB application which contains some JSP pages. This is the index page Metric to Imperial Converter

Meter to Yard Converter

Enter Meter Amount:
Enter Yard Amount:


60. Finding Errors in JSP page with PMD

61. Dynamically loading the jsp page to the application

hi i am building a application and in that application the user should be able to create forms with the form elements he wants i.e a normal form which we fill to apply for anything. I would like to know how can i do this.He should be able to get the values that are entered in the form.

62. Go back to previous page using session in JSP page

Hi Friends, I created 4 jsp pages; page 1 for login for shopping cart page 2 for selecting items page 3 for address of the customer page 4 for confirm items selected i have a "back" button and "ok" button in page 4 . if i select "back" button I should go back to page 2. when we go back to ...

63. Add data to combobox in page load

64. show a value in javascipt in the jsp page

65. Controlling Page Scroll Position in Jsp....f there are fewer than 4 pages only that n

My pager looks like previous 1 | 2 | 3 | 4 next Previous and next are not active unless you advance to next which puts page number 2 thru 5. If there are fewer than 4 pages only that number will show. If there are more than 4 pages next is active and it scrolls the numbers to always keep ...