jsp

Detect in Javascript which form has been submitted

I have a rating system for a bunch of entries on a website, they are programatically placed in and therefore I have given them a unique form identifier by using a count. <form name="star"> <input type="radio" class="star" name="rating" id ="rating" value="Terribad"/> <input type="radio" class="star" name="rating" id ="rating" v...

Browser Compatiblity problem with Firefox

Hi, I have used a tag in struts1. with first value as "Select dealer". Other options im populating from a list. In IE it works fine. But in Mozila Firefox the initial value is empty. The all the options are there in the dropdown. Same code in other scenario works well even with Firefox. Have anyone Come accross this? ...

struts validator client side, alertbox without message

I use commons-validator v1.2 specification-version : 1.0 whereas my spec-version for struts is : 1.1. Although everything works fine except the message display in the alert box. The alert box display case are relevant. By instance this jsp field : <td class="RechBlocCiel"> <input name="nom" type="text" class="inputForm" size="2" ma...

Generating ordinal characters in JSP EL

Take the following JSP fragment: <c:forEach items="${items}" varStatus="status"> ${'A' + status.index} </c:forEach> The intent should clear, I'm trying to generate an 'A'-based character index for each iterations through the loop. In Java, this is fine (e.g. 'A' + 1 == 'B'), but JSP EL on Tomcat 6 barfs with java.lang.NumberFormatE...

Is there a Java equivalent for Ruby on Rails "url_for"?

I have written something like this pretty easily in C# (string GetUrl(new { controller = "foo", action = "bar", baz = "fnord" }), based on the existing capabilities of the XmlRouteCollection class provided by the ASP.NET MVC framework (why it isn't there out of the box is beyond me; the additional required code was trivial). I am now fac...

Converting GET method url's to logical permanent links

Hi, I have a J2EE application with a web service which goes like http://servername/service?task=getFile&amp;id=25 How can I convert these type of urls to http://servername/service/getFile/25 http://servername/service/getFile/26 etc? Please provide your suggestions. ...

Efficient way to implement a client multiple file upload service

What is an efficient way to implement a multiple file client upload service? Are there any popular libraries for that? Basically I'm looking at a Web view, served a client, that would allow them to upload files: i.e browse their file system and choose say up to 6 files. Is implementing the above service better than a single file upload-...

Internationalization in a JSP web application?

In my current project, we are looking at phasing out our old presentation layer and replacing it with something more modern and more well-known. For various reasons, JSP was chosen as the technology. Possibly in conjunction with Apache Tiles. I should perhaps mention that we are using Spring in the back, if that matters at all. Internat...

What to do in "Error 404--Not Found" situation created by weblogic URL handling ?

I have a J2EE Struts app deployed on Weblogic 10.3. When clicking on one of the link it throws "Error 404--Not Found" however the same link works fine when the app is deployed on Weblogic 8.1. I have checked there is no change in the JSP code recently and JSP is copied correctly in the application directory. Please advise what I am miss...

https turns to http when redirecting from one jsp page to other.

My application runs in SSL now, in one of my jsp page i have used response.sendRedirect("xyz.jsp"); , so now when redirect occurs https is converted to http. How should i fix this? ...

Cross Site Scripting - Hidden Form Fields

My application is being penetration tested. One of the XSS items being flagged is that Im using a hidden form field to store a record id in a browser/search screen then using id this to open the full record. (via a post) I'm struggling to see how this is an XSS attack. Am I missing something? ...

Apache Jakarta Commons FileUpload package tutorial

Where can I find a good tutorial on the Commons FileUpload usage that walks me through a Java web application that features a file uploading? single and multiple file uploading Thanks ...

Redirect from login.jsp if already logged in

Hello If registered user jumps to login.jsp I wish to redirect him to youAreLoggedIn.jsp. Can this be made with <navigation-rule>? I know how to do this in PHP but not in JSP. When user visits login.jsp it must check if user is logged in this I know how to check. But how to trigger this action? Should I make a new servlet or what? T...

Accessing the implicit objects from a JSP EL function

When defining a function for the JSP expression language, is there a way to specify that the function requires one of the implicit objects (such as pageContext)? I want to define a function ${my:href('a.jpg')} to be implemented by public static String href(String fileName, PageContext pageContext) but I do not want to have to explici...

SEVERE: Servlet.service() for servlet jsp threw exception

I get the following error, what could be the problem: my context descriptor: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee ...

ModelAttributes not accessible on jsp

Created a new Spring MVC project using MAven and Im having a problem where the modelAttributes are not getting substituted on the jsp page. For eg., <%@ page session="false"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ page contentType="text/html...

Text on the Button with space in between disappears in IE

I have some 6 buttons to be displayed in the toolbar and the buttons have to be displayed in such a fashion that there is a grouping i.e 3 buttons followed by a bit of space and then again another 3 buttons. I am using JSF as the UI framework. The issue lies when my last button in the 1st group has text with space in between has to be d...

commons fileUpload: specifying an upload directory within Webapplication context

I'd like to know how to specify an upload directory preferably a relative path to a directory under my WEB-CONTENT directory where I'd like to store uploaded files: I get an error when I specify the upload be store as: **File saveFile = new File("/"+fileName);** please refer to code below Error: INFO: Server startup in 497 ms java.io...

JSP Custom Taglib: Nested Evaluation

Say I have my custom taglib: <%@ taglib uri="http://foo.bar/mytaglib" prefix="mytaglib"%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> <mytaglib:doSomething> Test </mytaglib:doSomething> Inside the taglib class I need to process a template and tell the JSP to re-evaluate its output, so for example if I have this: pu...

Howto solve jasper exception problem

This is what I got on the browser screen when I try to run the JSP file. The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory Stacktrace: org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatche...