jsp

Spring+JSP url building best practices

I wonder if there are any good practices for addressing Spring controllers in JSP. Suppose I have controller: @Controller class FooController { // Don't bother about semantic of this query right now @RequestMapping("/search/{applicationId}") public String handleSearch(@PathVariable String applicationId) { [...] } } Of co...

Java Web Application

I am interested in creating a simple web application that will take in user input, convert it to an XML file and send the file to a database. Coding wise I feel I am okay, it is just the general setup and what implementation to use I am a bit unsure of. At the moment I have a JSP page containing a form, the user fills out the form and...

Servlet doPost() Method setup?

I am interested in creating a web app that uses JSP, Servlets and XML. At the moment I have the following: JSP - Form input. Servlet - Retrieving Form data and sending that data to a java object. Java object (1) - Converts data into XML file....instantiates java object (2). Java object (2) - Sends that file to a database. On the re...

Jetty 7 hightide distribution, JSP and JSTL support

Hello guys. I've been struggling with Jetty 7 and its support for JSP and JSTL. My JSP file: <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; <html> <%@taglib prefix="c" uri="http://java.sun....

How can I access a JavaScript variable value in JSP?

function modification() { alert(document.getElementById("record").value); var rec=document.getElementById("record").value; <% Connection connect = DriverManager.getConnection("jdbc:odbc:DSN","scott","tiger"); Statement stm=connect.createStatement(); String record=""; // I want value of "rec" here. ResultSet rstmt=stm.exec...

Item value in JSTL foreach loop not working in Portlet

Given the following Portlet Code: ArrayList nameList = new ArrayList(); nameList.add("Willi Willisch"); nameList.add("Seppi Seppisch"); renderRequest.setAttribute("names", nameList); And the following JSP Code: <c:forEach var="aName" items="${names}"> <tr> <td>${aName} </td> </tr> </c:forEach> Prints out: ${aName}...

Is there any good reason to use <rtexprvalue>false</rtexprvalue> in JSP tags?

Is there any good reason to disallow scriptlet or EL expression to be inserted as attribute value? Let's say we have tag: <tag> <name>mytag</name> <tag-class>org.apache.beehive.netui.tags.tree.Tree</tag-class> <attribute> <name>attr</name> <required>false</required> <rtexprvalue>false</rtexprvalue> ...

Is there a way to use pre-existing JSP Tag libraries within the Lift framework (e.g. via snippets)?

Hi, I'm fairly new to Lift/Scala but like the ideas of less code writing and function passing etc. I've had a brief look at the Lift web framework but was wondering if it is at all possible to leverage pre-existing JSP Tag libraries, ideally while being able to still place/mix with Lift's snippet tags? As Scala is able to utilise norm...

JSTL Session Lookup - Key Has Periods

Hello All, I am working with some legacy code, and at some point there is a key in the session that is something like session.setAttribute("com.org.something.Object",someObject); Now trying to access this in a jsp using jstl is a bit difficult becuase if I tried it like I normally would I would do: ${sessionScope.com.org.something....

How can I concatenate a string within a loop in JSTL/JSP?

<c:forEach items="${myParams.items}" var="currentItem" varStatus="stat"> <c:set var="myVar" value="<c:out var="myVar" />" /> </c:forEach> I want to concatenate the values of currentItem.myVar and output it at the end of the loop, problem is I can't figure out how to do this... (Preferably not using Java) ...

passing form values from one jsp to another

hi i need to access form data given entered in one jsp in another.. this is how my code looks fisrt jsp: <form name="register" action="enterRegDetails.jsp" method="POST"> <input type="text" name="firstname" id="firstname" value="" size=25/> <input type="submit" value="SUBMIT" /> second jsp: <%=request.getParameter("firstame")%> ...

Displaying JFreeChart in a web page using Struts2

I am using Struts2. I need to display JFreeChart in a web page. Can any body help me on that? Edit: it is getting displayed in binary format. public String execute() throws Exception { System.out.println("Refresh bar Chart"); response.setContentType("image/png"); OutputStream outstream = response.getOutputStream(); try ...

Servlet/JSP Flow Control: Enums, Exceptions, or Something Else?

I recently inherited an application developed with bare servlets and JSPs (i.e.: no frameworks). I've been tasked with cleaning up the error-handling workflow. Currently, each <form> in the workflow submits to a servlet, and based on the result of the form submission, the servlet does one of two things: If everything is OK, the servlet...

How do you access second parameter of a servlet's web.xml file?

Say in my web.xml file, I define a servlet like so: <url-pattern>/MyURL/*</url-pattern> How do i access anything passed in the * in my servlet? I'm planning to use use this scheme for pretty(-ish) URLs. ...

How to insert JSP functionality in Servlets?

How can I use Servlets to access the HTML uses of having JSP without having to have all my client-facing pages called *.jsp? I would rather do this than using all the response.write() stuff because I think it is easier to read and maintain when it is all clean "HTML". Is this is fair assesment? EDIT: What I'm going for is having the Ser...

JSP Googlemaps taglib not found, where have I gone wrong?

I'm trying to add Google Maps onto my JSPs by using the Googlemaps taglib. I've added this into my maven pom <dependency> <groupId>com.lamatek</groupId> <artifactId>googlemaps</artifactId> <version>0.98c</version> <scope>provided<>/scope </dependency> This then included the googlemaps-0.98c lib...

Get all parameters from JSP page

I have n number of text fields named in the form "Question.....". How can I get all the parameters which starts with "question" from the JSP page to the Action? ...

Problem with detecting the value of the drop down list on the server (servlet) side

Client code is pretty simple: <form action="DDServlet" method="post"> <input type="text" name="customerText"> <select id="customer"> <option name="customerOption" value="3"> Tom </option> <option name="customerOption" value="2"> Harry </option> </select> <input type="submit" value="s...

Custom Tag implementation issue

I have customs tags as follows. repeat and heading tag have doAfterBody method implemented.Both of them extends BodyTagSupport class <csajsp:repeat reps="5"> <LI> <csajsp:heading bgColor="BLACK"> White on Black Heading </csajsp:heading> ...

Implementing logout function

Hi, I am working on my final year project which is an web based application. I want to implement logout function in that project. But don't know how to do that. Also I want to implement auto logout functionality i.e. after a particular time period say after 20 minutes a user will be automatically logged out if he/she does not perform any...