jsp

Servlets - Browser can't access css, images when doing a forward to a JSP?

I'm having trouble with loading css and images when I have a servlet forward to a JSP. Specifically, when I set my welcome-file to index.jsp, the css is being loaded and my images are being displayed. However, if I set my welcome-file to HomeServlet and forward control to index.jsp, the css is not being applied and my images are not bein...

What should be the best design approch

We have a simple table with employee data containing a 100k records. We want to display them using pagination on a simple JSP page with helper class/bean. On one page we'll display 50 records. Shall I fetch 50 records as per the page number & display them/ Use some other alternative? What should be the best design approach to this pro...

Object Element Content for 508 Compliance

One of the 508 compliance rules are that all OBJECT tags should contain element content. I'm not familiar with OBJECT tags or anything, but what should the content usually be? I noticed if I just put any string within the OBJECT tags I seem to pass the 508 test. Is it acceptable to put anything within the OBJECT tags to make this pass v...

Expire the page after submission

I'm implementing an iAuth form for a credit application in a J2EE container (JSTL+JSP+Stripes). The vendor states in the implementation guide: Expire the “Questions” page after answers submission When performing iAuth transactions you will need to “expire” the page on which the consumer's questions will be displayed after they h...

How to read a Excel file that is selected and submitted in JSP form ?

The end user will select an excel file on executing the below jsp program. <form action="?? " method="post" enctype="multipart/form-data" name="form1" id="form1"> Upload File: <input name="file" type="file" id="file"><br><br> <input type="submit" name="Submit" value="Submit"/><br><br> <input type="reset" name="Reset" v...

Calling Servlets from JSP

Hi, I am newbie to servlets and JSP. I am trying to call logger servlet from jsp. The requirement is such that the servlet returns control to the jsp(after logging events). The servlet needs to be transparent i.e. based on the performance the logging feature may be turned off. Is JSP:INCLUDE the only way to go? Are there other approach...

steps to integrate .chm help file into java application (jsp page)

i created one .chm help file with help of fast-help software but not getting any solution for how to integrate that in my web project i created in java using jsp and servlets in eclipse IDE. so,please help me out ...

Interpreting request as JSP instead of through servlet

This should be relatively simple to do but I've yet to find a description of how to do it. My setup is a simple web app that processes every request through a servlet (I'll call it MyEverythingServlet for this question). Here's a slightly modified version of my web.xml: <servlet> <servlet-name>MyEverythingServlet</servlet-name> ...

Spring MVC bind comma separated list to multi-select

tl;dr: I have a custom object that isn't a Collection. How can I get Spring to bind it to a multiple select? I have an object Field that contains a field called value, which is a String, with getters and setters. Sometimes the value field contains a single value and those will be displayed in a text box. Other times the value field wi...

How to get path at browser in jsp

Hi, May be this is the basic Question. But i am not able to understand how to get it. My browser url is http://testweb/edit.htm'. testweb is context path. This uri is from Spring. I need to get edit.htm which is after context, in my jsp. How to get this. Thank you for the support Thanks, Santha/ ...

Event like .net's "Application_Start" and "Begin_Request" for java/tomcat/JSP?

Is there a way to attach to events like asp.net's "Application_Start" and "Begin_Request" in Java/Tomcat/JSP web projects? I would really rather not use JSF or an extra framework(Spring, Struts). I do not want to do it on a per-page basis with anything like 'jspInit', a global event handler is the goal. In the event that I am stuck in t...

How to prevent duplicate URL concatination after redirect?

Hi, I wrote a page login.jsp (tomcat6) which has login form (username, password etc). I've mapped the form action and servlet so the form submission results in invocation of login servlet. 1. login.jsp has form that invoke servlet. <form name="login_form" action="servlet/login" method="POST"> 2. servlet mapping in deployment descri...

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 value at second page or how to x:out $titleValue at second page? this is my code at first page : <x:set select="title" var="titleValue" scope="session"/> <x:out select="$titleVa...

How to handle request on the page that was previously forwarded by servlet?

Hi, I have a JSP page that has 2 forms running on Tomcat 6. One is register form, Second is login form. (please pay attention to context path, it's going to kill me later) (regis_and_login.jsp) <% String path = request.getContextPath(); %> //regis form <form id="regis_form" name="register_form" action="<%= path %>/servle...

How to handle Servlet program on submitting a JSP form.

JSP CODE: Upload File: <input name="file" type="file" id="file"><br><br> <input type="submit" name="Submit" value="Submit"/><br><br> <input type="reset" name="Reset" value="Reset"/> </form> I have the above JSP file which will be executed with the help of Tomcat server and this is stored in the following location of my syste...

How to make a nice jsp GUI without using HTML tags?

I'm new to servlets and JSP and I'm trying to discover forms, and how to make my own web form. I know HTML but and I see examples for using HTML tags in the servlets, but isn't there a more higher level way to just say "Make a form here, make a table there" without getting my hands dirty with HTML tags? I want to build a war file and d...

Possible to specify access to isAttribute vs getAttribute in JSP EL?

Our Topic object has BOTH isChannel and getChannel public methods. The object graph is too complex to change this. Channel has an Integer type. We are migrating from one application server to Tomcat. When using this expression ${topic.channel.type}, in JSPs our current app server finds the getChannel method. However, Tomcat finds the ...

How do I include another login page and direct the user to one of the two login pages based on his url?

Here is my code to handle one url redirect but how do I implement two url redirects based on the user's url? <%@ page language="java" contentType="text/html; charset=ISO-8859-1" import="com.example.common.config.RuntimeConfig" %> <html> <head> <% response.setHeader("Cache-Control","no-cache"); // HTTP 1.1 response....

In which project context would you use Velocity instead JPS2-EL?

We are going to start a very small web development project. The team has experience using Velocity in the past, which was a clear option when we were working with JSP 1.2, long before 2.0... but now we have JSP-EL available. Therefore: would you recommend to get rid of Velocity and to invest in JSP2? We are inclined to do so in order to...

Catch Exception in finally { } ? Must ?

I feel puzzle ... I write a small routine in .jsp. Finally, ResultSet, Statement and Connection are required to be closed. I also write the closing codes in finally { }, but when the page is run, it return error that I didn't catch exception ... I read some forum. Other people didn't catch any exception in finally { } Any Hint ? ...