jsp

Evaluate variable before passing to JSP Tag Handler

When trying to use a custom JSP tag library, I have a variable defined in JSP that I would like to be evaluated before being passed to the tag library. However, I cannot seem to get it to work. Here's a simplified version of my JSP: <% int index = 8; %> <foo:myTag myAttribute="something_<%= index %>"/> The doStartTag() method of my T...

Repopulating Table Driven Drop Down

Scenario: A user fills out my JSP form by selecting his/her state from a drop down list. (The drop down list is populated from a database) The user hits "Next" on my form to go to the next page. The user goes back to the previous page by hitting "Back" on my form. Problem: The State field does not repopulate with what the user selec...

How to create Java Custom Web Controls?

This question was originary in my head as "Can I use AWT controls in a Servlet?", which will show all my ignorance on the subject. I am new to JAVA technologies but after a bit of reading, I seem to understand AWT controls directly hook up the OS GUI elements so there is no way to use or extend JPanels, JButtons and so forth in a Servl...

Jsp/ Html Page to Pdf

Hi all, How to convert as PDF from my Jsp/Html file?. i want to convert particular part of my webpage to pdf file. is it possible? Gnaniyar Zubair ...

Java to JSP. How to?

hi i have written a java program which currently runs as a desktop app, it is returning all results accurately as required in the console. I am now faced by a challenge to convert this application to a web application (JSP). Currently, the code for my projects is in user/workspace (as i am using eclipse) and my tomcat has been insta...

How to escape-html in JSP before saving to database ?

Hello everyone! I am learning JSP and Java at the moment and wrote a (very) simple guestbook to get started with JSP. But i want to ensure that noone can use CSS, so i need to strip the HTML code before saving it to my mySQL database. I already searched here and found the " PreparedStatement pStmt = conn.prepareStatement("INSERT INTO...

JSP: EL expression is not evaluated

I have a JSP page running on Tomcat 5.5. I have the following code: <c:forEach var="i" begin="1" end="10" step="1"> <c:out value="${i}" /> <br /> </c:forEach> The output I am getting is: ${i} ${i} ${i} ${i} ${i} ${i} ${i} ${i} ${i} ${i} I cant work out why the forEach loop is working but the output is not working. Any...

what is asp's Request.ServerVariables("AUTH_USER") jsp equivalent?

well, on a IIS web site with integrated windows authentication and no anonymous access, I can retrieve the logon username of the user, something like like domain\user... is it possible to achieve this with jsp on tomcat? (or any other container) I've tried with request.getHeaderNames (on tomcat) but I only get host, user-agent, accep...

Populate Vector from JSP, Output Vector to JSP

Hi this is a trivial question, but I cannot seem to get it to work. I am populating a vector from my jsp. (I have verified that the vector has elements in it) Now, I want to output the contents of the same vector back to my same jsp. Any takers out there for some code? ...

call 2 or more views with one controller in spring java

hi guys and girls. i want to call 2 views within one controller in spring with java. for example this.controller.view('header'); this.controller.view('body'); this.controller.view('footer'); how can i do that? or it is possible in spring? or can you suggest any other way to do it? and can i call a view inside a view. for example in v...

Formatting file sizes in Java/JSTL.

I was wondering if anyone knew of a good way to format files sizes in Java/JSP/JSTL pages. Is there a util class that with do this? I've searched commons but found nothing. Any custom tags? Does a library already exist for this? Ideally I'd like it to behave like the -h switch on Unix's ls command 34 -> 34 795 -> 795 2646 -> 2.6K 2...

improving jsp looks ?

i am using jsp with struts . I want to improve the looks (user interfaces / web page appearance) . How do i go a about. I am using a style sheet now . But I am not a good HTML degigner. Can anyone provide me a nice style sheet . I am doing a Course management system project and I am a student. please help does jsp support any inbuild su...

JSP and java script

i want to know how to run two functions in the same page in jsp ...

Clearing session on one page

I have two pages, and both repopulate the fields of the page with what the user enters as the user navigates back and forth from the pages. Is there any way to clear the field of just one page. I was looking at the .invalidate method... ...

Google code contacts importer

Hi, I have created a JSP which is supposed to fecth contact list from GMAIL, i have added all the required jar file in class path, Here is teh library which i am using http://code.google.com/p/contactlistimporter/ Bellow is my code, <%@ page import="com.xdatasystem.contactsimporter.*" %> <%@ page import="com.xdatasystem.user.*" %> ...

exporting tables to excel sheet in jsp

how can i export my table to excel sheet in jsp?? ...

Problem with caclulating and displaying floating point numbers in JSP

I'm trying to take two 7 digit numbers (source and target record counts) and calculate the percentage of missing records in the target count. For example, my record counts could be 4084094 for the source, and 4081313 for the target. I'm also using the follow formula to calc the percentage: ((1 - (target / source)) * 100) For my exampl...

Generating and visualising a decision tree

Hello I wonder if anyone is able to help or advise with the following; I have to be able to take data from a data source and to be able to visualise that data as a decision trees on a web page all. This will be a single process which is seamless to an end user. This will be done using JSPs and Java servlets but what concerns me are the...

Avoid looping xml in jstl

I would like to do something like this: <x:out select="$productXML/product/sizes/size[<c:out value='${param.sizeIndex}'/>]" escapeXml="false"/> but I think the only way to do it is like this: <x:forEach var="size" begin="${param.sizeIndex}" end="${param.sizeIndex+1}" select="$productXML/product/sizes/*"> <x:out select="$size" e...

send json object to jsp

i have a json object in a javascript file. i have to pass this object to a jsp file.the jsp picks up this object and processes it. how can i do it? ...