jsp

how to access properties in the test attribute of a struts if tag

I'm iterating over an array of beans called 'classifications'. How do I access the parentID property within the tag? I tried %{parentID} but that does not work. <s:iterator value="classifications" status="theStatus"> <s:if test="%{parentID} == -1"> <p>-1: <s:property value="subjectName" /></p> </s:if> <s:else> ...

Calling a VB.NET web service with Java

Hello, What is the best solution (if any) for calling a vb.net web service with Java / JSP? If anyone could point me to any examples / references I would very much appreciate it. Thanks! ...

I can pass a variable from a JSP scriptlet to JSTL but not from JSTL to a JSP scriptlet without an error

The following code causes an error: 1. <c:set var="test" value="test1"/> 2. <% 3. String resp = "abc"; 4. resp = resp + test; 5. pageContext.setAttribute("resp", resp); 6. %> 7. <c:out value="${resp}"/> The error says "error a line 4: unknown symbol 'test'". How do I pass test from the JSTL code to the JSP scriptlet? ...

How can I create Thread safe JSP page

Hi All, I want to create a Thread safe JSP page. It is possible in Servlet by implementing SingleThreadModel interface but I don't know how to do it in JSP page. ...

Application that provides local and remote access to data

Hello, I need to develop an application with following features and want to understand if GWT can be used to develop this application or is it the right technology to use ? 1) Backend is in Java and uses MySQL 2) Desktop based UI to create some datafiles and data will be stored in MySQL DB. This app will generate the data. 3) A desktop...

Convert integer value to string using JSTL/EL

How do I correct this statement: ${model.myHashtable[model.data.id]}. myHashtable is defined as Hashtable<String, String> But, ${model.data.id} returns an int. I tried to do something like ${model.myHashtable['model.data.id']} But it does not work. Any other ideas, aside from changing the type of id to String? ...

Error in my struts Action class

I have a JSP where I am showing date and description from database. Every entry has a unique id, but I am not showing on the page(showing checkbox) These entries are thrown using a "logic:iterate", so the number of rows is always changing based on entries. Now these fields are shown as a text field so that the user can also update the da...

Problem in displaying dropdown box

<html> <head> <title>ADD URL Sources</title> </head> <body> <form action="Test1.jsp" method="post"> <br><br><select name="source" onchange=""> <option value="rss">RSS LINK</option> <option value="other">OTHER LINK</option> </select> <br><br> Enter URL to be added <input type="text" name="url" size=50> <br/><br>Enter the ...

Using Dropdown box in JSP code

<html> <body> <form action="Test1.jsp" method="post"> <select name="source" onchange=""> <option value="rss">RSS LINK</option> <option value="other">OTHER LINK</option> </select> Enter URL to be added <input type="text" name="url" size=50> Enter the Source Name of the URL<t><input type="text" name="source1" size=50> <input t...

How to obtain request attribute in JSP using EL?

I know this isn't hard, but I'm not having any luck. I want to make fooList from a Servlet available in a JSP. So in the Servlet I have: request.setAttribute("list", fooList); RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/myJsp.jsp"); dispatcher.forward(request, response); Then in the JSP, I want: <c:for...

Access the size of a collection in JSP/JSTL/EL

I have a List variable called services in my JSP page. I need to add some markup to the page if there's more than 1 element in the list. What I'd like to do is... <c:if test="${services.size() gt 1}"> <!-- markup... --> </c:if> But you can't invoke methods on Java objects in EL (I think this is perhaps the 364823782 time I've regr...

Open pdf file from jsp page

I am trying to open a pdf file using ServletOutputStream in JSP. The code is: response.setContentLength(statementVO.getOutputStream().size()); response.setContentType("application/pdf"); response.setHeader("Expires", "0"); response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0"); response.setHeader("Pragma", "pu...

Dropdown for Integer array using html:select

I have been working on stuts app where I'm using an Integer ArrayList. I need to create a dropdown to list the arraylist. I have been trying using html:select --> html:optioncollection. But I am getting error of Cannot create iterator for com.SelectTagForm@18488ef. code: <html:optionsCollection name="selectTagForm" label="grade" val...

How to "Purify" HTML code to prevent XSS attacks in Java or JSP ?

Hi, I'm writing a servlet-based application in which I need to provide a messaging system. I'm in a rush, so I choose CKEditor to provide editing capabilities, and I currently insert the generated html directly in the weg page displaying all messages (messages are stored in a MySQL databse, fyi). CKEditor already filters HTML based on a ...

Struts2 get the text boxes (dynamic) to action class

I have struts page where the text boxes are with dynamic ID and wanted to get this values into Action class. Can someone please help me with the code plz. ...

JSTL x:out not working with x:parse

I seem to be unable to use x:out to traverse parsed XML. I'm looking for ideas on what to check to get this working. When I take out the x:out the page renders without error so I am assuming x:parse is working fine. I also use x:transform in this same JSP and it works fine...so it SEEMS like the library setup is correct. <c:catch var...

JSTL <c:forEach items="${......" what are the type restrictions

I need to use a set to not allow duplicate values. I need to list them out using the JSTL <c:forEach items="${mySet}" var="set"> //Code work done here </c:forEach> Usually I use the standard array or List here but what are the type restrictions if I want to use a HashSet? ...

How to better transfer objects between Jersey restful enabled classes to JSP pages

I have this : public class Base { @GET @Path("/news/{page_number}") public Viewable news(@PathParam("page_number") int pageNumber) { NewsParams news_params = new NewsParams(); news_params.setPageNumber(pageNumber); return new Viewable("/news.jsp", news_params); } } and the news.jsp is : ...

how to solve error http status 404 in servlet jsp

Respected Sir/Mam, I am trying to run some basic servlet and jsp program with Tomcat. but it gives some error. I am using Tomcat 6.0.29 and jdk 1.6.0_21. I have done everthing properly. But when i click on WebAppl link in Tomcat then it gives below error HTTP Status 404 - /WebAppl/ type Status report message /WebAppl/ description T...

How to get field values and do a post in jsp?

Hi, i am working on a simple jsp page, it contain 2 textbox firstname and lastname,and a ok button, when textbox is filled and button is clicked, I need to get values of firstname and lastname and post to url http://mydomain/firstname/lastname, how to do this? ...