jsp

Passing Textbox values from one JSP to another JSP

hi all. I want to pass a textbox value from source JSP file to the destination JSP file on a href click event withour using javascripts. can anyone help me out in this? i tried using the following method but iam getting error like "End tag is required" <a href="/destinationFile.jsp?sDate=<%='+txtDate.value+' %>"> thanks in advance M...

Multiple file selection for an upload control

Hi, I was trying to do something like this: http://www.element-it.com/Examples/MultiPowUpload/AdvancedHTMLinterface.html But in my search for information I found that is not possible to perform multiple file selection with simple HTML and JavaScript (and JSP in the server side). There is a way to do this without using Flash? A third pa...

How to get web application path outside of a JSP page?

Hi, I am new to JSP and JEE. So maybe there is something very obvious that I missed. I have a web filter class that needs to redirect the web request back to the root of the current web application. But since our application is not deployed in the root, I need to know the path the the current web application. e.g. http://www.mydomai...

Encoding problem in JSP / Tomcat5

I have a web application running on Tomcat5. In a jsp page say page1.jsp, there are some check boxes, where title and value have some french characters (Français). When I select some of the check boxes and submit the page, it goes to page2.jsp where I am showing selected titles. Problem is, on this page the special characters are getting...

How to unit-test logic in jsp?

What kind of tools or techniques exist for this purpose? ...

how to access inner class field inside javascript

I am having a inner class(static) named SelectProdLineAssociationForm I have also given a declaration like this-- public SelectProdLineAssociationForm selectProdLineAssociationForm = new SelectProdLineAssociationForm(); now on onclick event I want to set the field in the inner class a value so i am document.forms[0].selectProdLi...

JavaBean Introspection in Servlets [Tomcat]

What is the equivalent "servlet code" for this: <jsp:useBean id="user" class="beans.UserBean" scope="session"/> <jsp:setProperty name="user" property="*"/> Tomcat translates this to: beans.UserBean user = null; synchronized (session) { user = (beans.UserBean) _jspx_page_context.getAttribute("user", PageContext.SESSION_SCOPE); ...

Incorporating Java Styles in code preview

I am creating a website where you have a text area to write java code and need to incorporate java style colors for classes, keywords etc.. just like a normal java editor would provide. Is there a plug-in kind of a solution for this. ...

Spring MVC; avoiding file extension in url?

I just started with Spring Web MVC. I'm trying to avoid file extenstions in the url. How can i do this? (I'm using Spring 2.5.x) Bean: <bean name="/hello.htm" class="springapp.web.HelloController"/> I want it to be: <bean name="/hello" class="springapp.web.HelloController"/> I cannot get it to work. Any ideas? Edit: Url-mapping ...

retain value of input type file in a jsp file while being dynamically generated

i have a jsp page where i have a input type file and i m allowing the user to browse files. i have one such input on jsp and the rest i m generating dynamically by javascript. this is my jsp code: <div id="labelContainer" style="display:inline"> <table align="center"> <tr> <td align="left"><input type="text" id="label0" name="label0" s...

JS exception in a JSP running on WebSphere 6.1

Hi All, I have popup searcher in my application which lists the available record as hyperlink. Onclick of these links we are populating a textbox with the value. The popup is opened using window.open method. The hyperlinks in the searcher looks like this: When I invoke the searcher with IE's debugging enabled I am getting an error at...

JSP and JSTL using c:import

Is there a c tag equivalent of the <%@ include %> tag? Basically, when using the c:import tag, I find that the included pages cannot use c tags unless I import the jstl/core file on the included page. Thanks in advance. ...

function in jquery

is there any existing function in jquery library with the help of which I can submit request and be able to show other page. like for example in my case I have a page where there are gif's existing on that and onclick of these gif's I have to show other page, is there any function available. ...

Ensuring configurable date format for each user across jsp's

Hi, JSTL provides the fmt:formatDate tag for formatting dates. The way to use it is: Now, in an application you do not want to specify the hardcoded format of "dd/MM/yyyy" in all your jsp's or other pages. Especially since you need to ensure that the format is configurable for the user. One possible solution is that you specify a form...

Tomcat: Set cookie value multiple times for 1 request?

I'm running into a problem with Apache Tomcat 6.0.20 where I can't change a cookie's value once it has been added to the response. Basically, I'm trying to replicate Session functionality using cookies. I have a custom "Session" object, which is backed by a cookie. When I create my Session, I pass it an HttpServletResponse, and it cre...

JSP:Servlet:How do I set session timeout of greater than 30 minutes

Dose anybody know how to set session timeout greater than 30 minutes? these two methods wont work (default to 30 min). <session-config> <session-timeout>60</session-timeout> </session-config> and session.setMaxInactiveInterval(600); Thanks. ...

How to send parameters from a servlet

Hello, I am trying to use a RequestDispatcher to send parameters from a servlet. Here is my servlet code: protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String station = request.getParameter("station"); String insDate = request.getParameter("insDate"); ...

Multiple Pages Inside One Portlet

I am curious if anyone knows if it is possible for a single portlet to contain multiple pages, let's say JSP pages. Furthermore is it possible to link to these different pages within the same portlet? For example. Let's say I have a single portlet. And in this portlet I want the initial view to be a JSP page with just 5 links on it to 5...

Where does JSP initialize?

I have a project which works fine. bookstore example I didn't understand where it initialize JSP's variable? There is no beans. All we have is Java class. JSP calls java class's variable but how? I searched into all the configuration files but nothing found. public class Bookstore { private final Map<String, Item> items = new Tr...

Form gets submitted even if JavaScript fun returns false

Pls check code .html form gets submitted even if javascript returns false. <form id="form1" name="form1" method="post" action="sub.jsp" onsubmit="return getValue()"> <input type="text" id="userName" name="userName" onkeyup="return getValue()" /> <input type="submit" name="Submit" value="Submit" /> </form> <script type="text/jav...