jsp

JSP:forward Question

I am just getting started on web app development. I have an index.jsp that has just ONE line. < jsp:forward page="landing.do?"/> What does the above line do? page="landing.do?" actually refer to? what does the question mark "?" next to "landing.do?" signify? As Bozho rightly pointed out, a servlet called "action" ...

Unterminated string constant

My Description contains an apstrophe('). How to escape it. <a href='javascript:select("<%= pageBean.replace(list.getColumn(0), "'", "'") %>", "<%= pageBean.replace(list.getColumn(1), "'", "'") %>");' title="<%=selRpt%>"> <span class='img-view'></span></a> "<%= pageBean.replace(list.getColumn(1), "'", "'") %>" is the description part i...

Unterminated string constant

My Description contains an apstrophe('). How to escape it. <a href='javascript:select("<%= pageBean.replace(list.getColumn(0), "'", "'") %>", "<%= pageBean.replace(list.getColumn(1), "'", "'") %>");' title="<%=selRpt%>"> <span class='img-view'></span></a> "<%= pageBean.replace(list.getColumn(1), "'", "'") %>" is the description part i...

disable a sellect input based on another select input in jsp page using javascript

i have two select input fields in a jsp page. i want to disable the second input based on the value of first input. i wrote the function. but it is not working, plz help. function selectTimePeriod() { var rtype = document.getElementById('customer.customerType').value; var corporateSize = document.getElementById("customer.corporateSize"...

java inheritance and JSTL

I want to acces to an attribute inherited by one of my java classes, in a jsp using jstl 1.2 : Java : public class LigneDeclarationBean { private ELigneDeclaration ligneDecla; private ETypeFormulaire typeForm; ... public ELigneDeclaration getLigneDecla() { return ligneDecla; } public class ELigneDeclaration ext...

what is the difference

hello what is the difference between <%+i%> and ${i} ...

JSTL foreach on enum

I have a contant list declared in java using enum type, that must appears in a jsp. Java enum declaration : public class ConstanteADMD { public enum LIST_TYPE_AFFICHAGE { QSDF("qsmldfkj"), POUR("azeproui"); private final String name; @Override public String toString() { return name; ...

JSTL: can't implement class for tag <c:forEach>

Hello! I'm trying to write a class for this (forEach) tag. Here's the class: public class BookList implements Iterable<Book> { public ArrayList<Book> book_list; public BookList() { book_list = new ArrayList<Book>(2); book_list.add(new Book("BookTitle_01","book_01.html")); book_list.add(new Book("BookTitle_02","book_02.htm...

sql result set to Output JSP page

I have a sql query fired in my model class which returns a table of user data. Now i need to display the result on my view page (JSP). I don't want to fire the sql from JSP page. How do i pass of the result set to JSP? do i need to construct a collection set and pass it on to the JSP or is there any better way to do it? Thanks, -Vijay ...

Display tag library duplicating ID's

We use Display Tag Library. We have two tables on our page with DIFFERENT id's but they are being rendered with the SAME id (the id of the first table). Why is Display Tag Library using the same id when we have supplied different id's? We only noticed this problem when upgrading our system to JBoss (from Weblogic) and upgrading to J...

How to hide application context from urls ?

I am using JSTL c:url tag to define my URL's in the application, something like: <c:url value"/home" /> But the problem is that it appends the application context to the url, so the link becomes http://appName.come/appName/page while it should be http://appName.come/page. The link had to be with slash, because it's not relative. I wa...

How to detect dynamically if the app is under local/online environment

greetings all i want to detect dynamically if the application is under local environment (development) or online server environment, through the httpservletRequest maybe , i don't know, any ideas ? ...

Spring and Hibernate: How to modify user authorities using jsp and checkboxes

I am using spring security and have an admin jsp page for editing user details. I want to be able to grant or revoke authorities on this page. The following checkboxes tag works to display a given user's existing authorities: <form:checkboxes path="authorities" items="${roles}" delimiter="<br />" /> where authorites is an attribute ...

Jsp include, forwarding request parameter

In my jsp file I am pulling data from the request via request.getAttribute(). Inside this jsp I need to include another jsp. Will this inluded jsp have access to the request, or do I need to somehow forward on the data? ...

Illogical jsp error

I want to dispaly a result parameter which return from servlet to jsp after an event happen. so when i add new user for example a result parameter returns with value that the user has been added successfully , and i want to display the result in jsp page. i make like this in jsp page <%String result = String.valueOf(request.getAttribu...

Modify Web App layout

I am making changes to an existing web app project which currently has web pages for ONE LAYOUT, say, for example, BLACK. My layout blackpage1.jsp is made up by assembling Struts Tiles - title, header, footer. My current layout blackpage1.jsp looks like: tiles:insert title tiles:insert header tiles:insert footer I would...

ajax + servlet country state city list

I am trying to populate city, country and statelist using ajax, and servlets. Now I know how to get the XMLhttpRequest object. there is a standard mechanism to do that and depending on the cross browser compatibility, you do get a ActiveX or a xml object.. Then you send a request to the actionservlet, using xmlhttprequest.open() and you...

Automation for JSP Multilingualization

An existing set of JSPs, hard-coded with English field labels, javascript error/info messages, image 'alt' message etc. needs to be multilingualized. What would be the best way to go about converting these JSPs to use the standard Java Multilingual features (resource bundles, locales etc)? ...

Iterate over Map object using JSTL

Is it possible to implement the following using plain JSTL: <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <table> <% java.util.Map msgMap = (java.util.Map) request.getAttribute("messageMap"); for(int loopCount=1;loopCount>0;loopCount++) { if(msgMap.containsKey("/p...

Using jQuery/JavaScript Code in JSP

I have jQuery code in a JSP: ${'#userid').val('admin') The app server is interpreting the jQuery code as JSP: The function val must be used with a prefix when a default namespace is not specified How do I "escape" the JavaScript? ...