jsp

JSP/Servlet: Uploading File issues

Hi , I have the below code: boolean isMultipart = ServletFileUpload.isMultipartContent(request); out.print(isMultipart); // Create a factory for disk-based file items FileItemFactory factory = new DiskFileItemFactory(); // Create a new file upload handler ServletFileUpload upload = new ServletFileUpload(factory); // Parse the request...

JSTL: Check if Submit was clicked

How can I check if the Submit button was clicked in JSTL? ...

Why do my anchor tags contain my request context path before the path I specify?

I'm using Apache Tomcat 6.0.26 with java servlets and JSPs. Whenever I'm trying to link to an external website, my anchor tags always contain my request context path before the external link. For example if my context path is http://localhost:8084/MyWebPage/ and I'm trying to link to www.google.com via this tag: <a href="www.google.com...

Upload a zip file, unzip and read file

Hi, i am using NetBeans, and i am working on a jsp page that allows the upload of a zip file. The zip file contains 6 CSV files, that is to be written to the SQL database. My question is, how do i go about allowing the user to upload the file, unzip it in the jsp page, and allow me to read the file? Thanks in advance! ...

Including a jar file in another jar file in netbeans

I have created an applet and made its jar file in Netbeans. i am using a jar file in an applet. I am calling the applet.jar in a jsp page. The applet works fine but the functionality it has to be achieved is through the another jar file which i was using in that applet. means how to include an external jar file in applet.jar so that it ...

I want on select value in one combo the other will fill on same page

Hi all I Have two combo box And I want on select value in one combo the other will fill on same page and the value come from database in both combos. any idea Thanks ...

refresh jsp page

Hello everyone how can i refresh a jsp page from other jsp page i have a jsp (jsp1) page that hold 2 frame of jsp i need that the jsp (jsp2) will refresh the other jsp (jsp3) and another question same one as above only with servlet how can i make a servlet page refresh a jsp page ...

httpcontext session value is becoming null in other scriptlet of same jsp page

Hi, I have a jsp page which has different IF conditions.On load of the jsp page,one of the if condition will be invoked based on value set to fuse action. I have a problem like, first time when the page is loaded then IF condition1(say, for ex) is invoked and a variable is assigned to the HTTPCOntext session object. Second time when the...

back button not working in internet explorer, working good in mozilla firefox and google chrome

I have a form page where I have a back button and a print button both on the top and bottom of the page(coded in javascript). The back button at the bottom of the page is not working in the Internet Explorer whereas the top one and both the print buttons works good. The code chunk is same for both of back button. In addition all the butt...

Spring MVC: best way to set global debug flag

I'm using Spring MVC and my jsp's have a <div id="debug"> section that I would like to be able to show/turn off conditionally while we are in development. For example, if I am looking at page www.example.com/main, www.example.com/main?debug=1 would show me the information that is contained under the debug div. Is there an easy way ...

What is the syntax for EL that accesses List with object?

I'm having tough time figure out how to display object's properties in ArrayList using EL expression. Many tutorial outside shows simple example like: List<String> test = new ArrayList<String>(); request.setAttribute("test", test); test.add("moo"); And it works fine. <p>${test[0]}</p> When the ArrayList contains actual object with...

Getting HTTP 404 Not Found with multiple requests while using form based authentication

Hi, I am having an issue with Tomcat and Websphere when users try to login in our application. If a user presses multiple times the return key after entering his/her login details, the form is submitted multiple times. Tomcat and Websphere don't ignore the multiple requests and end up complaining about the /j_security_check url not be...

Calling a custom JSP tag from JSTL tag

I'm trying to call my custom tag from the JSTL tag <c:url>. Because of the quotes, the custom tag is shown as a string instead of a tag. Can I use an escape character here? <img align="left" src="<c:url value='/getFile/getfile?<myTag:getValue type="web" name="person" />'/>" alt="person" title="person" width="55" height="70"/> ...

Wanna find books on JSP best CMS creating practices?

Wanna find books on JSP best CMS creating practices? (wanna create one... so just need to read books first) ...

Platform-neutral JSP Zip File Upload (Google App Engine / Tomcat)

Is there a consistent code-base that allows me to upload a zip file to both GAE and Tomcat-based servers, extract the contents (plain-text files), and process them? ...

Custom tag not evaluating expressions; c and fmt tags are evaluating expressions

I have a .jsp page that begins with <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="/WEB-INF/mytags.tld" prefix="mytags" %> With the header of mytags.tld having the following content: <taglib> <tlib-version>1.0</tlib-version> <jsp-version>1.2</jsp-version> Expressions are supported by the core tags, so ...

programmatically put the calling servlet into the action of an HTML Form

in a controller servlet I have the doGet as protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { RequestDispatcher view = req.getRequestDispatcher("views/insert_item.jsp"); view.forward(req, res); } in the view insert_item.jsp I want to post back to the same calling servlet b...

Mysterious Eclipse JSP Validation Errors

Eclipse (Helios) occasionally marks valid looking JSP content as having errors. It seems like it often breaks when I use the <c:if> tag. For example, in a JSP with just this content: <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <html> <body> <c:if test="${1 == 1}"> something </c:if> </body> </html> The following ...

How to manipulate Data Transfer Object if sql join 2 tables?

I have a query in Data Access Object DAOComments that joins users table and comments table and then store the result into Data Transfer Object DTOComments: private static final String SQL_FIND_WITH_USERNAME = "SELECT u.username, comments.* FROM users u JOIN comments ON u.id = comments.id ORDER BY created_date DESC LIMIT 10;"; However...

Why use the j_username and SPRING_SECURITY_LAST_USERNAME variables?

Why do this? <input type="text" name="j_username" value="${SPRING_SECURITY_LAST_USERNAME}"> instead of this? <input type="text" name="username" value=""> What's the value of the j_username and SPRING_SECURITY_LAST_USERNAME variables? ...