jsp

How to disable default servlet container session?

In J2EE web application, how do I disable the default HttpSession creation? We have our own way of tracking session, we don't use default jsp/servlet session but the default session sets cookie in browser which I would like to avoid. Right now on every JSP page we specify as session="false" in page directive but often some developers mi...

When should you use textual "or, and, not" over symbolic "||, &&, !" logical operators in JSP EL?

The textual versions may improve readability for non-programmers, but otherwise I can't imagine any differentiators. ...

Spring MVC rendered JSP truncated when containing special characters

If I pass variables with extended characters to my JSP, the end of the rendered file is truncated by 2 bytes for each non-ascii character. Why is this so? Here is an example. My Controller: import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestM...

Can I ignore some jsp files when pre-compiling jsp using tomcat?

I'm pre-compiling jsp's in a webapp using tomcat as described here: http://tomcat.apache.org/tomcat-6.0-doc/jasper-howto.html#Web_Application_Compilation Is a way to exclude a subset of jsp files in the application? According to the documentation of org.apache.jarsper.JpsC it offers no such thing. But I was wondering if someone has come...

How to dynamically set header value in JSP

I have a JSP file which creates an Excel document. I want to dynamically set the name of the file to be downloaded. This is how I set the file name to "test.xsl": <% response.setContentType("application/vnd.ms-excel"); response.setHeader("Content-Disposition","attachment; filename=" + "test.xsl" ); %> How can I set the file nam...

Using JSP Bean in a Servlet

So I'm using a bean on a JSP page to store some data, like so: <jsp:useBean id="data" class="myclass" scope="session" /> Is there anyway to access this bean from a servlet at a later time in the same session? EDIT: Apparently I'm not accessing the same session when I load the jsp page and the servlet. I'm printing out the session ID ...

JSP page and Servlet reporting different session IDs

I'm setting a bean with some data in a JSP page, but then in my servlet when I try to access the value, I get a null value back. I printed the session IDs in both pages and I'm getting different values. Does anyone know what might be happening? Thanks. ...

Pass session from jsp to asp.net

My website login page is in jsp & some of modules in .net , So i want pass the session to .aspx page so that access those module Thanks in advance ...

Possibility to use <c:import> with spring views

I was wondering if there is a possibility that I could use the JSTL function to import spring Views. so something likes this: <div id="contentHolder"> <c:import url="/foo.do?bar" /> </div> In the XML stands: <!-- Viewresolver --> <b:bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver...

I want to create a login page using servlets.

I want to create a login page using Servlet & JSP. I ve created a page which gets Username & password. I made a database with a table which contains Username & password. <form action="LoginPage" method="POST"> User name: <input type="text" name="userName" size="20"><br> Password: <input type="password" name="password" size="20...

JSP/JSTL using or not using <c:out> tags

i'm helping develop a java jsp jstl based web service and all dynamic objects are being inserted using ${object.foo} and i was wondering if it made a difference whether or not it was actually in <c:out value="${object.foo} />? the pages all load correctly, but i wonder if there is something that i'm not seeing that may be an issue. ...

Can i use iterator within iterator on jsp in struts2.0 ?

This is the ArrayList defined in the private ArrayList<LocWiseSaleParam> locWiseSaleList; where LocWiseSaleParam is myaction class I am using a iterator on jsp and accessing its values. but can i use the iterator with the same value as nested iterator <s:iterator value="locWiseSaleList" id="list" > <s:iterator value="l...

Setting directory permissions for JSP/Tomcat/Windows

Hi All, I have a web app consisting of some JSPs that were previously running on a Linux box. I need to get this running on a Windows XP SP3 machine running Tomcat 5.5.29. Most everything is working now but this one item: The app has a capability to write a configuration file to its Windows directory (i.e. C:\Program Files\Apache\Tomca...

How do I create a direct link to a jsp file in Liferay

I want to create a direct link to one of my jsp pages in Liferay. I noticed that creating the link by simply specifying the path does work. Please does anyone know how I can do it. ...

Trying to create a table in Struts2 from an ArrayList

Hi, I am trying to create a table to display some data I pulled out from a database into a JSP page (all part of a Struts2 application), and I don't know what I'm doing wrong here... This is the part of my JSP page where I create the table: <table> <s:iterator value="table" id="row"> <tr> <s:iterator value="row" id="...

JSP/JSTL word wrap in a table

I have a table of width 800 and one inner table within that of width 100%. The tr td looks like this <tr><td align="right" valign= "top"><c:out value="HOUSE: " /></td><td nowrap align="left" valign= "top"> <c:out value='${houseBean.houseLabel}'/></td></tr> Now when houseLabel goes beyond 5 values, the table grows beyond its width of...

Redirecting after writing to response throwing exception

Am working on an application which has a requirement to download bulk data from a file server with a maximum file size constraint fixed at 3 Mb.It means i would have a maximum download capacity of 3Mb.I am writing the input stream to the response output stream .My problem is I need to redirect my response to a jsp page after I downlaod.N...

Looking for a question that combines the understanding of few web technologies

I am teaching a web development course at a CS department, I wrote most of the final test by now, each question focus on a specific feature or a specific technology, I wonder if you can think of/recommend a question that combine the knowledge of few technologies.. The course mostly covers: HTML, CSS, JS, HTTP, Servlets, JSP and JDBC. ...

Image counter in JSP

Need to do Image counter in JSP for how many clicks have clicked for advertisement? Front-End : JSP Backend : Mysql or Any other procedure methods for counting number of clicks in advertisement using JSP ...

JSP, Google app in hosted mode, static variables

When I launch my site in hosted mode all variables that are declared as static preserves it's values among different requests. It works fine(?) when I upload it to google app servers. I.e. I have public static String action = "index"; and if I set its value to "someval" in another request it appears "someval" instead of "index". Is it...