jsp

Error in jsp when i use bean , can any one help?

I want to use bean in my jsp page but run time occure and i can't resolve. Error: An error occurred at line: 28 in the jsp file: /WEB-INF/AdminPages/AddUser.jsp listOfGroupNo cannot be resolved 25: %> 26: <%! void addGroup(int no) { 27: 28: listOfGroupNo.getGroupList().add(no); 29: } 30: 31: %> is that error means the obj...

How to set the <%= ...> in to a loop counter?

Hi, everyone, I want to ask a question about the JSP. I writing the following code in the JSP page. However, when I set the <%= obj.getCounter()%> (use-defined method) to be the loop counter, I found that it does not work. Can anyone help me? Thank you. The following is the code. <% private int loopTime = <%= obj.getCounter()%>; %> <...

cannot use the inclide file in JSP

Hi, everyone, I want to ask a question about the JSP page. I set the project in the following structure in order to manage the project efficiently. When I in the list folder, main.jsp, I set the header as the following <%@ include file="universe/header.jsp" %> When I open the main.jsp, It shows the error "cannot find the "jsp/list/un...

JSTL c:forEach, decremental number loop impossible?

I want to print decremental numbers like: <c:forEach var="i" begin="10" end="0" step="-1"> ... ${i} ... </c:forEach> then I got jsp exception: javax.servlet.jsp.JspTagException: 'step' <= 0 javax.servlet.jsp.jstl.core.LoopTagSupport.validateStep(LoopTagSupport.java:459) org.apache.taglibs.standard.tag.rt.core.ForEachTag.s...

Spring 3 - Petclinic - ${owner.new} invalid expression in Tomcat 7

I have deployed the petclinic code from the SPring 3 svn samples repository in Tomcat7 and I get the following exception: Internal error Root cause is: /WEB-INF/jsp/owners/form.jsp(4,1) "${owner.new}" contains invalid expression(s): javax.el.ELException: [new] is not a valid Java identifier org.apache.jasper.JasperException: /WEB-IN...

convert UploadFile object to a ZipFile object

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <% // decode source request: try { MultipartFormDataRequest multiPartRequest = new MultipartFormDataRequest(request); // get the files uploaded: Hashtable fil...

How do I use the latest version of jQuery and get back the '$' for jQuery in RichFaces?

RichFaces 3.3.3 comes baked in with jQuery 1.3.2 and prototype and scriptaculous as well. How can I try and use the latest version of jQuery? Can I use the Google CDN one? Also the $() object is defaulted to prorotype and to use jQuery I have to do jQuery() is there a way to get back the $ for jQuery without breaking RichFaces? UPDAT...

Remove images when exporting to Excel from webpage

I'm using a jsp page to export a set of tables to Excel. All the data exports fine and I can use css to format everything, but when i try to hide the images that export, they will not do what I want (i want them to be gone). ...

jsp refers to an PDF streaming servlet - security question

Somewhere behind our firewall sits a server full of PDFs. The PDFs contain private information so I need to restrict access to the PDFs. The public can log in to our web site and request their PDFs. Our software went to production recently. We're redirecting them to the PDF server's URL. This fails because the public can't access ou...

div open itself in a new window from a jsp?

I have a jsp "template" view in which I am including content from several other jsp's. The content from the other jsp's is being included into a <div> in the template file. Inside the included jsp's I want to have a hyperlink called "popup" (or whatever). When this link is clicked, then the content of this included jsp is "popped out"...

data binding to drop down box in Spring MVC

hi, I have simple spring mvc web application.I want to bind list into drop down.In this case list items are normally bind into drop down; but If I select item and click submit button it is always passing "0" instead of value. This is my controller. public EditEmployeeController() { setCommandClass(Employee.class); setCo...

Taglib in Java: tag with array parameter

Hi, How can I define a tag that receives a array as a parameter? Thanks ...

Track online users

i am developing a web application. In that i want to check online users & visited users. I am using JSP for that. Will you plz send me the code for that? ...

java.lang.ClassNotFoundException: org.apache.struts.taglib.bean.CookieTei

i am finding java.lang.ClassNotFoundException: org.apache.struts.taglib.bean.CookieTei. i have already struts2-core-2.1.8.1.jar, struts2-json-plugin-2.1.8.1.jar on my classpath. ...

Login system in .jsp

I have a login.jsp page which contains a login form . Once logged in the user will be taken to index.jsp and this index.jsp should know which user is logged in . If the user refreshes the page he will stay logged in and not taken back to the login.jsp. So there need to be some sort of session. I searched for an example and found about Ja...

Parse JSTL XML inside JSF

I'm working on a project which I need to generate a form dynamically. The user chooses the component he wants to put on the screen and the program adds it in the form. To do so, I'm using XML to define the current state of the form and at first sight I thought in using XSLT to make the transformation to JSF but now I am evaluating JSTL t...

How to display the contents of an arraylist in a drop down box

I have a sql statement that pulls infomration about tagnum's for individual pidm's. Every pidm can have multiple tagnum's so I am dropping the information into an arraylist. I want to display the contents of this arraylist in a dropdown box on a html page. Here is the code for the arraylist: <table style="border:transparent" st...

Clean up Browser Cache

Hi, I´m programming Java App. and get an error, because browser dont connect to server to take new values, just renderize from cache... I make something like this: <% if(request.getAttribute("msg")!=null) out.println("alert("+request.getAttribute("msg")+")"); %> It works fine, but when i click on a link and then click on BACK butt...

send more than one parameter to servlet through anchor tag

i want to send more than one parameter to servlet through anchor tag . but the problem is one parameter is the return value of java script method . For more Explanation ; <% int cnt = 1;%> <c:forEach items="${requestScope.AllUsers}" var="user"> <tr id="<%=cnt%>"> <td >${user.userName}</td> <td>${user.emailAddress}</...

What is the lifecycle of a HttpServlet?

Hi all, Basically, how long is an instance of a servlet around for? I am kind of guessing it is session scope. However, I suppose it could have some sort of timeout or garbage collection to remove old instances. Thanks, Grae ...