jsp

JSP Expression Language Error Behavior?

I'm running Tomcat 6.0.18 on Linux. I have a JSP that uses a bean like this: <jsp:useBean id="helper" type="com.example.SomeType" scope="request"/> The page references an attribute of helper with the expression language like this: <!-- This works properly, but could fail silently if the bean name is incorre...

What kind of problems may occur when executing a JSP page?

Hi, So I have an example question as follows: Explain how a JSP page is executed and what kind of problems may occur. I'm fine with the first part, compile the static html and the scriptlets to java to be served by the servlet etc. But I'm stumped by what problems may occur? The JSP page is held in memory... so maybe that may exhau...

What is causing this MySQLSyntaxError exception?

Hi all, i written this query (in java class) to select some information from the MySQL database and view it on jsp page... SELECT instructor.name FROM instructor,section,teach WHERE teach.student_id='3'AND teach.section = section.number AND section.instructor_id= instructor.ID but there is exception was occur! javax.serv...

Restricting the scope of a model in JSP

If i put an object named "foo" into model in Spring controller, and want to limit its scope, how can I do this. Let's say I have a page which uses a jsp tag that takes as a parameter "foo". If I call the tag inside jsp, like <tag foo="${bar}" />, it seems to me that the model "foo" is interfering with the "bar". Or even if not, if I j...

Need pageEncoding/charset not to be defined in header (JSP)

I writing a JSP program that needs to react on an existing program. It gets several variables that the JSP program needs to process and generate a response. The existing program has his custom headers like: Content-Type: application/x-server-response But the JSP program returns its content with the wrong headers. Like this: Content-...

setting value by clicking button in addition to using action

Hello, I have two bean Code: public class ApplContactDtl { ....... And Code: public class ApplNotifBean extends ApplNotif{ ... private List<ApplContactDtl> contactsList; ... Inside my JSPX I'm displaying the list of ApplContactDtl entries for every entry of ApplNotifBean I would like to add a delete action for these entries ...

How to create a Tabbed interface for two different web applications to be displayed as a single page

We have two separate web-apps, say 'retailUI' and 'bulkUI'. These two are basically two separate web applications (within the same business domain). Now, the requirement has been given to us to make the two work together in one page with a Tabbed interface (as a PoC). My problem is that both the applications span over a number of JSP pag...

JSP to PDF Conversion

Hi Friends, I am Shrikant. I am facing the problem of JSP to PDF Conversion.Here I am developing an web application in which their is a functionality SAVE AS PDF. When we click on that button or link i want to convert JSP pages to PDF format. Eagerly waiting for your help.If you have any ideas please suggest me. ...

Whitespace before XML declaration from JSP

Hello I'm trying to achieve full XHTML transitional validation of my JSP output but I've hit a snag. The top of the header looks like this: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; It is included with a stat...

JSTL access a map value by key

I have a Map keyed by Integer. Using JSTL, how can I access a value by its key? Map<Integer, String> map = new HashMap<Integer, String>(); map.put(1, "One"); map.put(2, "Two"); map.put(3, "Three"); I thought this would work but it doesn't (where map is already in the request's attributes): <c:out value="${map[1]}"/> Follow up: I tr...

Java Struts list listKey listValue listClass?

Well new to the java stuff and having trouble with assigning a class attribute to this SELECT options. wanted to know if the listClass is correct? What I'm trying to accomplish is to add a class attribute to the options of a SELECT drop down What I have: <select> <option value="volvo">Volvo</option> <option value="saab">Saab</optio...

JSPs and trademark symbol

On the web pages in our app, the trademark symbol (TM) is appearing as a questions mark. The registered trademark (R) works, though. We are displaying the value using the c:out tag in the JSP standard library. If I put &trade; or &#8482; on the page to test this, those show up as they are supposed to. <td><c:out value="${item.descriptio...

Is it possible to access struts2 variable in jsp scriptlet?

Hello friends, Is it possible to access struts2 variable in jsp scriptlet? If I have struts2 variable like <s:set var="test" value="%{'true'}"/> Can I use variable "test" in JSP scriptlet? If yes. How is it possible? Can anyone give some idea about it? Thanks. ...

want to add dynamic content on jsp page

Hello All, I am using Struts2 tags for my designing page at front end side. Now i have a requirement for in my jsp page that i have put 3 simple fields & on some add link i want to so repetitively some another 3 or 4 field at same form dynamically. For example if user clicks 5 time on add link then 5 time that 3 or 4 field have to sho...

jsp array list problem

hi i am trying to create an array that doesnt add items if the value/size is more than 20. this solution adds only 1 item and then stops even if the value is less than 20. how do i change it so that it accepts values only upto 20 max. package business; import java.io.Serializable; import java.util.ArrayList; public class Cart implemen...

Javascript source files on JBoss have the wrong content-type/mime type?

I am writing a JSP application and am deploying it to JBoss 5.0. When I attempt to retrieve my CSS or Javascript files, JBoss returns the wrong Content-type for the file, so Firefox refuses to execute code supplied in them. Here is my web.xml file: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLS...

Encoding problems in JSP

I have an html-form with several text fields. When I try to submit not English characters (Russian in my case) server is received "unreadable" string (not questions - "???" but some strange characters). I simplified my code to show it here: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ page contentType="text/...

Internationalization inside Javascript

Hi all, I have a JSP page which accepts user string in more than 23 languages.So a user in English gives 8.5 the javascript function should accept as well as user from Russia gives 8,5 it also should be accepted it as valid input. In this scenario how do we validate in Javascript for all the languages ...

Conditionally Render In JSP By User

I'm trying to make a simple forum just to get the hang of the Spring Security and MVC frameworks. For simplicity's sake, let's I have a JSP to view a forum post, which looks like the following: <body> ... Title: ${forumPost.title} <br> Author: ${forumPost.author.name} <br> Message: {forumPost.message} <br> <securi...

<html:errors> struts tutorial or example

Hi, I'm trying to make a login page in Struts. The idea is to validate if the user exists, etc, and then if there is an error, return to the login page with the errors in red (the typical login or any form page validation). I would like to know if someone knows an errors management tutorial in Struts. I'm looking specially for a tutori...