jsp

Difference between web-server and servlet container.

What is the difference between "A Web Server" and "A Servlet Container"? In general are all Web Servers Servlet(Web) Containers too or vice versa? I have been using Apache Tomcat for JSP and Apache for PHP but unable to figure out the exact difference between those two, where exactly lies the difference? I tried searching previous thre...

Listener Class not invoking method ?

I'm working on a Dynamic Web Project in Eclipse. The whole project was loading properly upon clicking the run in server button, a week back. But yesterday, when I pressed the run in server button, the console would give an error message stating that it can't load the Servlet Context. The server is Apache Tomcat 5.5 and the following is t...

need help calling a remote server with JSP

I'm writing an application in JSP that needs to reach out to a remote cgi which will feed it some data. Is there a JSP specific way to do this that is less brute force than simply using the httpConnection library and reading a bitstream? ...

Getting wrong characters in parameter

In files.jsp I am using following anchor and JSTL c:url combination - <c:url value="downloadfile.jsp" var="dwnUrl" scope="request"> <c:param name="fileType" value="PDF"/> <c:param name="fileId" value="${file.fileId}"/> <c:param name="fileName" value="${file.fileName}"/> </c:url> <a href="${dwnUrl}">Download</a> On downloadfile...

Tomcat 6.0 does not allow generic ArrayList to be used for useBean

In a jsp file I have this declaration: <jsp:useBean scope="request" id="products" class="java.util.ArrayList<sgt.supermarket.entity.Product>"/> This declaration works fine with GlassFish 2.1, however, when I switch to Tomcat 6.0, exceptions is thrown: The value for the useBean class attribute java.util.ArrayList is invalid. Is there...

server side get multiple select values

A continuation of the previous question: http://stackoverflow.com/questions/1905534/multiple-select Is there a way to get the selected values in jsp(server side) ? ...

Writing a variable into the JSP request scope doesn't work

I have a problem where I am trying to set a variable in a JSP page that should be available to all other pages serving this request. <c:set value="foo" scope="request" var="bar" /> However, when I try to read the variable from another page (the master JSP that puts everything together) it is empty. Should this ever happen? Is there so...

How to put "new line" in JSP's Epression Language?

What would be right EL expression in JSP to have a new line or HTML's <br/>? Here's my code that doesn't work and render with '\n' in text. <af:outputText value="#{msg.TCW_SELECT_PART_ANALYSIS}\n#{msg.TCW_SELECT_PART_ANALYSIS2}"/> ...

Curly brackets in JSP code

I have a JSP page I am working on and I am confused by some of the formatting/coding. There are sections where it's obvious what's going on: <% if (.....) { %> <input type=hidden name="blahblah" value="moreblah"> <% } %> But now I see sections where I have no idea how or why it works/compiles: <% { ...

Replacing div content using jquery in a jsp

So far I've been making an AJAX call to replace the content of a div with another page, using the following code: <script> function fetchContainerContent(url, containerid) { var req = false if (window.ActiveXObject) { try { req = new ActiveXObject("Msxml2.XMLHTTP") } catch (e)...

Different ways to use properties file in j2ee app

I have a j2ee app using Struts2. I have a gloabl properties file which is declared in struts.properties which resides in WEB-INF/classes. It has the following setting: struts.custom.i18n.resources=mypropertyfile mypropertyfile also resides in WEB-INF/classes Say for example it contains the following: pdf.test.title=PDF Test then...

pdf in iframe in jsp on tomcat, also Struts2

Hello Everyone, I'm having some issues getting my pdf file to display in my jsp page. I have the pdf saved on my tomcat server with a file location as follows c:/tomcat 6.0/webapps/appname/reports/saved/filename.pdf I am trying to open that file (preferably not using the c: location) and displaying it in an iframe in my jsp file using ...

Programmatically Determine Java Session Timeout

Is there any way for a java servlet/jsp to determine the webserver's session timeout (in seconds, minutes, etc...)? I tried looking in the HttpSession and System API, but didn't see any property for determining the webserver's session timeout. I know that this value is set in web.xml, but I am designing a java library which needs to dete...

How to hypen words at end of line using javascript

This is my coding. The result of using css as class Hyphenate, the result is shows in result1. However, what I want is the result shows in result2. Also, in result1, when there are just few words, it gives wide gap between words, it's really ugly. Is anyone now how to solve this problem? --edit question-- What I am asking here is: I ha...

Hibernate displaytag big lists

Hi there, I'm using displaytag to build tables with data from my db. This works well if the requested list isn't that big but if the list size grows over 2500 entries, fetching the result list takes very long (more than 5 min.). I was wondering if this behavior is normal. How you handle big list / queries which return big results? ...

Is anyone still using JSTL?

I was about to pick up some Java web programming since not having touched Java for a couple of years. I picked up an fairly old O'Reilly book that was sitting on my bookshelf (Java Server Pages 3rd Edition, covers JSP 2.0 & JSTL 1.1) and started skimming the pages. I went over to download the latest JSTL libraries and noticed that they a...

How to create user-friendly and seo-friendly urls in jsf?

For example, I have class Article with methods getTitle () and getContent (). I also have ArticlesService with method getAllArticles (). How to create a list of links with meaningful names (formed with #{article.title})? Like: http://mysiteaddress.com/article/first-article-title http://mysiteaddress.com/article/how-to-make-links-in-js...

how to add content of word doc file in jsp file using include action?

I am trying to include the text content of microsoft word file in my jsp file.... I am not able to figure out the solution. ...

JSP Problem ussing implicit object (session) in a function

Can the object of type HttpSession called session be accessed from a function? In a simple jsp page I have a function(see below) defined in the header of the page, and set to an onclick handle of for a button. When I press this button, I'll never see the second alert message. If I do something in the body of the page (like Session ID...

When will session be expired?

I set session timeout to be 5 minutes in web.xml. And once session expired sessionDestroyed() will be executed. But I want session to be alive as long as browser window is still there. So in each JSP page there is a piece of JavaScript code that visits an image on the server every 100 seconds. Basic idea regarding this part can be found...