jsp

Getting the refresh count on server side of GWT web app

I am working on converting the functionality of some JSP pages to GWT. I noticed that javax.servlet.http.HttpServletRequest request is an implied object in JSP, and one can obtain the client's refresh count by calling request.getParameter("refreshCount"). I noticed that one can also access this request object in GWT in the service impl...

What does "generalizes the tag object's storage" mean?

Hi, could anyone please clarify the meaning of line generalizes the tag object's storage of attributes in the following line of Head First Servlets & JSP (page no. 555): One solution would be to put all of the attributes into a hashtable. This generalizes the tag object's storage of attributes, but what about all these setter m...

AccessControlException creating file inside JSP

I try to create a new file inside a JSP and try to save it: final File file1 = new File("piechart.png"); ChartUtilities.saveChartAsPNG(file1, targetChart, 600, 400, info); I get a AccessControlException: java.security.AccessControlException: access denied (java.io.FilePermission piechart.png write) at java.security.AccessControlC...

Redirect all requests for a subdirectory in Tomcat 6.0

Hello All, I'm running a local Tomcat 6.0 server on my desktop. I'm trying to redirect any and all requests matching http://localhost:8080/RedirectDirectory/abc/efg/morejunk to a single JSP page. In my RedirectDirectory project's web.xml I have <servlet> <servlet-name>IOPRedirect</servlet-name> <jsp-file>/RedirectDirectory/filetree....

How much can IntelliJ's CSS on-the-fly validation do?

I've been looking into IntelliJ's advanced features, specifically its on-the-fly CSS validation (their site says that it can find "Unused CSS class definitions") to help us clean up our massive CSS files in our hundreds of JSP pages. IntelliJ has so many features and seems to be pushing the envelope in many ways but how much can IntelliJ...

How to display a different JSP view for different types of objects

Assuming I have a list of Animal(s) with standard polymorphic behavior like Cat(s) and Dog(s). What is the best approach to display a different JSP view for each one in the list? <c:forEach var='animal' items='${animals}'> //show a different template per animal type </c:forEach> To be honest having a #toJSP for each bean is somethin...

Getting the JSP URI that was sent to the GET/POST of a Servlet

Is there a way to get the URI of a JSP that sent a particular GET/POST request to a Servlet? I know of the request.getRequestURI() function within a Servlet, but that is just returning the URI of the Servlet itself. For example: Let's say that index.jsp sent the request to the Servlet SampleServlet. I want to get the URI of the ind...

Javascript preventing Spring form from being POSTed

Strange problem going on here. I'm developing a JSR168 portlet that is using Spring and the Spring form taglib. I have a search form on a page to go through a catalog of reports based on the criteria the user selects, and for the most part it works fine. However, there is one sequence of events that is triggering an error. I have a Jav...

Is it possible to download a binary file from JSP?

I think is it quite possible, but I'm not sure. I don't have the possibility to use servlet directly, so I'm forced to use JSP ( long history, short time, you don't want to hear ) So I think something like the following will do: // PSEUDO-CODE: // source.jsp Download your file <a href="file.jsp?xyz">MyDocument.doc</a> // file.jsp ...

JSP Page HttpServletRequest getAttribute Typecasting

Hi There, Any ideas on the correct method of typecasting an Object out of a getAttribute request from a JSP page HttpServletRequest? I have googled but it seems that the common solution is just sticking suppresswarnings in your code... Something I would very much like to avoid. I currently have: HashMap<String, ArrayList<HashMap<Stri...

Java/JSP/Tomcat web hosting

Hello guys, I am looking for a hosting solution for my Java/JSP web application. Do you know any servers which provide Tomcat hosting for v5 or greater and MySQL database? ...

Rendering chart inside jsp without storing

I have created a chart using JFreeChart inside a JSP. I want to render this chart in a webpage using JSP, without storing the image as JPEG/PNG file. This is in the google app engine environment which does not support writing to disk. I tried the following: java.awt.image.BufferedImage chartImage = targetChart.createBufferedImage(600,4...

Java Servlet/JSP Cookie Disconnect

Hey guys. I'm having a strange issue with cookie visibility between an authentication servlet and our actual jsp. We're using a servlet to authenticate that the user is a valid user, and if they are, we go ahead and add a cookie to the HttpServletResponse with their referer url (this is so that integrations can be redirected to their ow...

How to load a .properties file into a jsp

I've gotten as far as this: private Properties logoUrls = new Properties(); logoUrls.load(new FileInputStream("channelLogos.properties")); where channelLogos.properties is in the same directory as my JSP. I get a FileNotFound exception. Where does my app actually think I mean by "channelLogos.properties", if not the same directory as ...

JSP - Passing Parameters between JSP pages

How can I pass Parameters between JSP pages using pure Java Code? I.e. I don't want to use codes like the following: <jsp:include page="<%=fileName%>" flush="true"> <jsp:param name="txtUsername" value="<%=_USERNAME_%>" /> <jsp:param name="txtName" value="<%=name%>" /> ...

JSP - File upload with Apache Commons

Why my file-upload code is not working? I am using "commons-fileupload-1.1.1.jar". Also I am seeing a strikethrough in the 2nd Line on "isMultipartContent" in NetBeans 6.1. // Check that we have a file upload request >>>> boolean isMultipart = FileUpload.isMultipartContent(request); // Create variables for path, filename a...

Problem in interpreting dynamic attributes in Jsp

Hi, I'm trying to process dynamic attributes in Jsp, but I'm getting display nothing in response. Here's the JSP code: <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="mine" uri="DiceFunctions" %> <html><body> <mine:advice suggest="yo haa haa" > </mine:advice> </body></html> The TLD file, whic...

How do I preserve the form value after refresh browser?

I have one simple JSP having four buttons ( Button1 , Button2 , Button3 and Button4). The button value set into hidden field when I click on button. I need to get the latest button click value after refresh the page ( preserve the button value). could anyone please help me ? <script> function one(tab){ document.getEleme...

Java Header not displayed

i am inclduing a header.jsp in my layout.sp but it does not get reflected in the browser and have tried both mozilla and ie even after refreshing cache.. header.jsp content--- <h1>Login Application</h1> layout.jsp content-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-tr...

Help getting image from Servlet to JSP page

I currently have to generate an image that displays the text of a string, i need to make this image on a Servlet and then somehow pass the image to a JSP page so that it can display it. I'm trying to avoid saving the image, and instead somehow stream the image to the JSP. I haven't found a way of generating the image since i started wit...