jsp

Dev server for Java, like VS has for .NET?

Hello, I am on a Java learning spree recently, however I am normally a .NET developer. (So please forgive my newbie questions.) In .Net I can develop ASP.Net pages without using IIS, as it has a watered down web server (Cassini, I think it's called). Does Java or a Java IDE have something similar so I can write and test JSP and Java S...

How to avoid using scriptlets in my JSP page?

Hi, I've been told that the use of scriptlets (<%= ... %>) in my JSP pages isn't such a great idea. Can someone with a bit more java/jsp experience please give me some pointers as to how to change this code so its more 'best practice', whatever that may be? This JSP is actually my sitemesh main decorator page. Basically my web design h...

Any tool to view web session attributes?

I use jsp/Servlets for my web layer. Is there any tool to examine session attributes in a web session? ...

Image refreshing using Ajax & jsp

I’m using Ajax in jsp, I have to refresh image for every 30 seconds by using some data base values. Can any one know how to refresh image? Please send me some code examples. Thanks. ...

JSP Page Variable Caching

I've encountered a problem with JSP pages server-side caching. Suppose I have an internal error page which is a custom JSP that will display a unique ID each time it's visited/requested. This unique ID is also logged in the server log for debugging. However, I noticed that if I implement the error ID using: <%!private String <b>abc</b>...

Concatenate strings in JSF/JSP EL and Javascript

Hello, I'm having troubles with EL and javascript functions (JSF 1.2, Facelets, Richfaces 3.3.0GA). I have a page that includes another composition: <ui:include src="/pages/panels/examinationPanel.xhtml"> <ui:param name="prefix" value="new" /> And in my ui:composition I want to append the prefix to every id. For example: <rich:modalP...

Troubleshoot JSP nullpointer exception problem

I am looking at a very old project and trying to fix some problems that this project is facing with related to its JSP pages throwing nullpointer exception. The JSP page is throwing a null pointer exception like the sample below. /e2fo/tools/user/search/searchUser.jsp. Exception thrown : java.lang.NullPointerException at com.ibm._...

jsp:param no longer sets parameters when original request is wrapped with a HttpServletRequestWrapper

I have a filter that takes an incoming request, and then wraps it with an HttpServletRequestWrapper, which in turn has a setParameter() method on it. However, this will no longer work now in any filtered servlets: <jsp:include page="testing-include.jsp"> <jsp:param name="testing" value="testing" /> </jsp:include> The include page ...

Spring application root variable

I access my Spring application right now as follows: http://localhost:8080/my-app In my JSPs I'd like to have access to my application root instead of hardcoding hyperlinks to the homepage as <a href="/my-app">. Is there some sort of variable that I can access in my jsps to point to the application root? Thanks ...

What are the differences between JSP and Facelets?

Hello everyone. I'm new to Web Development, so please be patient with me. This might be a dumb question, but I need to get these terms clear in my head! I just started reading the Java EE 6 Tutorial, and I'm a little confused! I knew about JavaServer Pages (JSP), and even did some coding during my undergraduate studies. But now, in thi...

Escaping & in a URL

I am using jsps and in my url I have a value for a variable like say "L & T". Now when I try to retrieve the value for it by using request.getParameter I get only "L". It recognizes "&" as a separator and thus it is not getting considered as a whole string. How do I solve this problem? ...

Java Tomcat web form submission tries to download foo.do entry text/x-server-parsed-html

Web form submssion tries to download foo.do (for example). This downloaded form is the "thanks for submitting" the user normally sees after submission. The email that this page sends comes through OK. Both the shtml from which the form is submitted and the response that tries to download have a meta content tag of text/html. I havent g...

Why do we need out implicit object in JSP When we are supposed to use expressions?

I am studying JSP. I have a doubt. When we use the Expressions in JSP, then why do we need out implicit object in JSP? Can anybody explain on this. Thanks ...

How to get CPU utilization on jsp

I need to get the cpu usage of the current process using jsp. My scenario is like when user navigate from one page to other I need to check the cpu utilization, memory usage of the process. ...

Loading alternative content via tabs and jQuery and JSP

Hi. I have a table of data for a policy type (options are Single, Couple, Family & Single Parent Family). I want to have a tabbed interface with each policy type occupying one tab. At the same time a table of data relating to relevant policy type is displayed beneath the associated tab. When a user clicks on another tab then a diffe...

Java/JSP How to get domain URL + web application name?

Here's the scenario. My Java web application has a following path https://www.mywebsite.com:9443/MyWebApp Let's say there is a JSP file https://www.mywebsite.com:9443/MyWebApp/protected/index.jsp and I need to retrieve "https://www.mywebsite.com:9443/MyWebApp" within this JSP file. Of course, there is rather a lazy + silly way of j...

jsp error message not displaying

on JSP when I want to display error messages but when it returns to JSP page by <form:errors path="arnNumber" cssClass="error" /></span> it is giving me an exception org.springframework.context.NoSuchMessageException: No message found under code 'ARN number is required.contactUsUtil.arnNumber' for locale 'en_US'. ...

Package not found in jsp

i have added new project in my workspace which is having 2 projects A and B respectively. now i have added third project C in build path as well as in project reference of A. i am using some package c.foo.* of C in Project A's test.jsp but while importing c.foo.* package i am getting error as Package not found. how i can access package ...

Unusual error while using Expression language in JSP only for particular king of properties- Check this

Hi, I have this unusual scenario: I have a registrationVO with few properties and getter setters for that. For example city or bCity with their getter methods getCity() and getBCity() In JSP i tried to display the value of these properties using scriplets, <%=registrationVO.getCity()%> and <%=registrationVO.getBCity()%> , It works fine...

Get filename of source JSP file (even if included)

I am trying to do some debugging of JSP files that include multiple levels of nested includes. e.g. foo.jsp <%@ include file="bar.jsp"%> bar.jsp <%@ include file="baz.jsp"%> baz.jsp <%@ include file="boz.jsp"%> To help determine where a certain file is actually included I placed a simple line to output a javascrip...