jsp

Struts 2 List Parameter Passing

How do I pass a list of integers using the s:a href and param tags in Struts 2? Example POJO: private List<Integer> myList = new ArrayList<Integer>(); public List<Integer> getMyList() { return myList; } public void setMyList(List<Integer> myList) { this.myList = myList; } Example JSP Page: <s:url id="testUrl" action="testA...

How do JSPs render

Let say I have something like this in a JSP: <li> <c:set var="sectionId" scope="request" value="${userSession.sect['Utilities'].id}" /> <a class="header" href="#category-2">Cat 2</a><c:import url="/resources/softwareCategoriesAccordion.jsp"/> </li> <li> <c:set var="sectionId" scope="request" value="${userSession.sect['Games'...

Struts - What changes are needed to add a new JSP?

I am making changes to an existing web application based on Struts1 - which already is made up of various forms & actions. What I am trying to do is Add a few pages for the mobile version of website. For example, I want to add a JSP page that contains a form with a few fields (same as that in the PC version) with a submit b...

JSP - Not able to maintain session between http page and https page

I can't seem to find the one right answer to my problem. I'm being overwhelmed with information I'm finding on the internet, and I have no idea what I should do. My setup is as follows : Apache server (front end), Tomcat 6.0 (back end), RapidSSL certificate is on the Apache server, my site is made up of Java Server Pages. The problem ...

Struts 1 map to static .xml file

I'm trying to map the path /crossdomain.xml to some xml content (whether its contained in a jsp, xml, or any other files, I don't care). I'm running struts 1, and I've tried this: <action path="/crossdomain.xml" type="org.apache.struts.actions.ForwardAction" parameter="/crossdomain.jsp"> </action> This technique works if I replace the...

how to decouple data from business logic

Here is the scenario, Let's say I have a user class like so: public class User{ private String firstName; private String lastName; //... // setter, getters } Then I have a class like so to handle user Comments: public class Comments{ // some fields public static loadComments(User user, int count){...} } So far very basic s...

JEE web.xml: How to exclude a single page from a <url-pattern>

I want on all pages BUT ONE (header.jsp) to include-coda like in this code: <jsp-property-group> <url-pattern>*.jsp</url-pattern> <include-coda>footer.jsp</include-coda> I just don't get how I can limit the Pattern to exclude header.jsp ...

JSP Shopping Cart

Hello all im making a simple shopping cart in jsp. In my view cart file im running a loop to display the various items currently in cart with option of update and remove from cart buttons. When any of this buttons are clicked I pass the id and price as hidden input elements to another file to process it. This works for when there is only...

How to interpolate java expressions in struts attribute strings

I have the following: <html:select property="myMap(abc)"> What I really need to do, however, is pull the string abc from a static member of a java class. I thought something like <html:select property="myMap(<%=MyClass.FIELD%>)"> , but that didn't work. What's the correct syntax here? ...

How do I setup Apache and Tomcat for JSP and SEO-friendly clean URLs

Hey guys, I'm looking for is a "Best Practices" approach for setting up Apache httpd (2.2) with Tomcat 6 so that we can: Allow JSP files to be served for directory listings (e.g. http:/www.example.com displays index.jsp via DirectoryIndex index.jsp). Hide the extensions of all URLs (both *.html and *.php files served by Apache and *.j...

Java code - looking for source code

I have this Java code some other person wrote, specifically JSPs. I am trying to understand where everything is. In my index.jsp (the main file which is loaded) it imports a certain namespace (I suppose tomcat does all the compiling, I don't know): <%@ page import="org.sgrp.SearchResults"%> This physical location doesn't exist in my ...

Spring 3 MVC: Show validation message with custom validator

Hi, I need help. I am beginner in jsp, MVC. I want to validate form input with custom validator in Spring 3 MVC. My validator class package validators; import models.UserModel; import org.springframework.stereotype.Component; import org.springframework.validation.Errors; import org.springframework.validation.ValidationUtils; im...

Tutorial for using spring beans in jsp pages

Hi guys, (I am not familar with technologies related to HTML delivery, like JSP... But I know basic concepts...) In my application I use Spring Beans and Spring Security together with Blaze DS to communicate with Flex applications over AMF protocol. Everything works just fine. Now I have a task to deliver some services via HTTP/HTML e...

Passing JSP encrypted parameters to frmservlet

I want to pass encrypted parameters via a JSP form to frmservlet.I want to pass userid by encrypting it.But it is not decrypt by the frmsrvlet,How can I do this? ...

graphics are not shown on jsp

in my application all jsp pages in jsps folder i give the path in index.jsp:<% response.sendRedirect(response.encodeRedirectURL("/Projectname/jsps/main.jsp")); %> although main.jsp is show but it does not show logo, graphics etc. all the js and logo files in js folder which is parallel to jsps and WEB-INF folders. now structure is: Proje...

Use NSMutableURLRequest with JSP

Hello, I'm trying to send an HttpRequest from an iPhone app with some parameters. The form is like this: foo.jsp <form action="/foo" method="post"> <div> <input type="hidden" name="id" value="1" /> <input type="hidden" name="vendidas" value="25" /> </div> <div><input type="submit" value="Send!" /></div> </form> So in the iPho...

Sharing DB Connections and already loaded scripts, styles on JSP Page

Hello everyone, I am currently trying to code our existing desktop application in JSP. To be able to maintain sustainability, have visual effects and get functionality, I have decided to use JQuery. After starting to code a month ago, we now realized that these pages are bringing a heavy usage of libraries (JQuery and JQueryUI librar...

Nesting templates in Tiles, why are attributes undefined in the included template?

I use Tiles 2 in my web application, and the basic setup I've got in my tiles.xml file is this: <tiles-definitions> <definition name="mainLayout" template="/jsp/layout.jsp"> <put-attribute name="header" value=""/> <put-attribute name="menu" value="/jsp/defaultMenu.jsp" /> <put-attribute name="content" value="...

EL enum string processing

I have a variable being passed to my JSP view from a spring controller that maps to an enum. It is being printed out at 'ENUM_VALUE', not very user friendly. What is the best way to convert this to a more readable form like 'Enum value'. I'd rather a pure EL solution so as to avoid writting more code in the controller to parse this, bu...

Only fraction digits with fmt:formatNumber?

Is it somehow possible to only display the fraction digits with fmt:formatNumber? I basically need to render a price-like double in two fields: decimal and fraction digits (123.456 -> 123 456) and I want to avoid string splitting etc. :-) The solution has also to work with a minimum number of fraction digits in order to create for inst...