jsp

include directive

Hi, Head First book says about include directive as include code from any other file into the JSP file at translation time, which can't be changed dynamically. However, I included a JSP file in the include directive, which generates a number randomly every time I access the page with include directive. And every time a new number gener...

enabling el in jsp

Hi, could anyone tell me how can I enable EL expression in JSP version 2.0? Every time I'm getting EL expression as an String literal in the JSP as an output. Here's the DD which the container is using to sending request to servlet, and then servlet dispating request to JSP: <web-app xmlns="http://java.sun.com/xml/ns/j2ee" ...

How do I debug JSPs on remote JBoss server?

I'm debugging an application on a remote server running JBoss using Eclipse. My particular problem is a NullPointerException in a JSP. The JSP has too much Java code inside scriptlets but, unfortunately refactoring is not going to be an option. Finding the line that throws the NullPointerException has been incredibly challenging and I...

Are static functions isolated in JSP/Grails applications under tomcat?

I'm using some legacy java code that consists of several static classes from with in a Grails app under tomcat. When I only have one user using the web application everything works fine. When two users use the application things start to go wrong. I believe it's because the static classes maintain resource locks such as sockets. Am I cor...

'#' character before EL expression used inside a JSTL tag behaves strangely

I have the following code to set a userId variable: (userId set in prior code) <c:set var="userId" value="(Cust#${userId})" /> Which produces the following string: (Cust#${userId}) The following code works as expected, however: <c:set var="userId" value="(Cust# ${userId})" /> displays the following string (Cust# 0001) . Why does...

Jsp doesn't see included taglibs. Seems to be a local webshpere 6 configuration issue?

Ill try to be as descriptive as possible. situation: struts tag's not being resolved on a jsp. When you look at what should resolve as links you see: <html:link page="/dto/initDTO.do"><b><i>Design To Order Control System ( DTOCS )</i></b></html:link> Which leads me to believe that the struts tag is not being resolved. The source o...

jsessionid is occured in all urls which are generated by jstl <c:url..> tag

I've got some strange bug: when I open page first time in some browser all references has jsessionid parameter (like <a href="/articles?name=art&jsessionid=5as45df4as5df"..>). When I press F5 or refresh the page by any other ways all that stuff is disappeared and everything works fine until I close my browser (and all tabs should be clo...

Setting a default value to a param in s:include

I am writing a small widget in struts which I want to include. The height of the widget should be auto unless I pass in a param of height. For example: # Example 1: <s:include value="myWidget.jsp"> <s:param name="height">300 px</s:param> </s:include> # Example 2: <s:include value="myWidget.jsp"> </s:include> Inside myWidget.jsp I...

How to clean session attribute from all active session in java ?

Currently I am working on web project which uses JSP/Servlet and struts framework. We are using cache mechanism. I want to clean some of the session attribute from all the active sessions on particular event (For e.g. in case of refreshing cache). So what is best way to implement same ? ...

Java bean with JNI ?

I have added native method in java bean code. Then i have copied .dll file in System32 folder. while using javabean in JSP. it gives an Error: HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperE...

uploading a file from jsp using servlets ?

i am trying to upload an image from a jsp page using servlet. but how can i get the file in my servlet from the jsp file. ...

When to use Servlet versus JSP Pages in Tomcat?

We have been debating between using servlets or JSP pages and we want to know what the common uses of one versus the other. If you read any online guide that you can point us out, will be very grateful. ...

how to use jsp tag library in my stand-alone (non J2EE) app?

This question asks about using JSP's scripting language outside a J2EE container. There are some good pointers there. However, I'm curious if I can use JSTL XML tags in my app. Any good pointers? Thanks ...

How to find out which HTML button was pushed in my servlet?

I am creating a registration form which contains two submit buttons. I need to know which button is clicked in the form in my servlet code? ...

Retaining the submitted JSP form data

I am having a web form(JSP) which submits the data to different application, hosted on different server. After submitting the form data, that application redirect back to same JSP page. Now, I want to save the entered the data. What are the different approaches to retain the submitted data in web form. I would not prefer to store the dat...

What are attributes?

Hi, Could anyone please clarify the defination of attribute? for example, in the following code, what is an attribute: request.setAttribute("ja",new foo.Employee()); Is the attribute in the above code an object of type foo.Employee(), or it is key/value pair, or it is actually "ja"? ...

Struts 1.x: Form isn't shown

Hi! I have a form like this, in a .jsp page (using Struts + Tiles): <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" p...

Share an applet across many jsp pages

In my web application, a series of jsp pages are navigated. These jsp pages appear on the Right Hand side (frame) of the screen. On the left frame, I have an applet. This applet is common to all jsps. From all of the jsps, I want to invoke a method on the applet. The javascript code is inside of each jsp. Is there a way to do this ? An...

problem with dbConnection, reading in context-params from web.xml

i have some jsp code that reads in Servlet Context parameters from a web.xml file. these parameters hold database connection information so each time the SID or user/password or servername changesm, the programmer doesnt have to go re-code; the user can just change the web.xml file. <context-param> <description>database user name</des...

Which Java templating system should I use to generate emails?

I have a website that uses JSP as its view technology (and Spring MVC underneath). Unfortunately, JSP is just a pain to use for anything that doesn't involve an HTTP session. I would like to be able to occasionally send my users some email, and I want to use something JSP-like to render the email's contents. Technologies I'm aware of ...