jsp

How to serve a file with JSP?

This may sound totally stupid, but is a case of real life :( I'm able to display a HTML table with a "virtual" link name. Something like this: Xyz description <a href="docId=123">document.doc</a> Xyz description <a href="docId=456">documentB.doc</a> Xyz description <a href="docId=798">documentC.doc</a> This doc id represents ...

What is a good resource for learning equivalent JSP, JSTL tags/EL, and Struts tags?

I'm looking to separate business logic from presentation in a project, but the business logic is written using a mixture of tag libraries. Are there any good resources for going from one taglib to another, converting Scriptlet code to EL and back, etc? ...

Best way to protect url so that only defined party can interact each other

I have jsp/struts application need to upgrade. Currently we only have 1 websystem(branch) and now I need to upgrade and build another websystem that represent HQ. HQ and branches are different domain. HQ can see 4 branches in the HQ page. We need to login to access HQ and branches. If HQ want to see the details in branch A, we can click...

how to make information displayed only in child window??

i hav written code for opening the child window(toolbar is disabled here) thro parent window by( using body onload function) calling the same(login.jsp) page again. wen the parent window (i.e login.jsp) opens for the first time in the browser(by typing the url) it displays all the information and then goes to child window where i have d...

How to iterate an Arraylist inside a HashMap using jstl?

I am having map like this, Map<Integer,ArrayList<Object>> myMap = new LinkedHashMap<Integer,ArrayList<Object>>(); Now i have to iterate this Map and then the ArrayList inside the map. How can i do this using jstl. ...

JQuery Integration with JavaEE

I have been able to use Jquery with ASP.NET because I know where to drop the JQuery Library, but I am trying to integrate JQuery with Java Web Applications using JSP's,Servlets, etc. It seems like a trivial question, but for some reason I am unable to figure out where to drop the JQuery Javascript file. ...

How to learn JSP/MVC, with previous experience in ASP.Net MVC?

Hi all, I just started to get into the door of the Java world. I have been programming in C# for the last 3 years, and been doing about 3 months of ASP.Net MVC. I absolutely love it, but the fact that I need Windows for it to run the latest and greatest libraries is a bit of a turn down... Plus I think learning another language helps wi...

JSP send cookie to a different sub-domain

Cookies are store under domain-name. For example, a cookie that generated by sub1.xxx.com/login.jsp can be stored in sub1.xxx.com, or xxx.com. Now I am wondering if we can store the cookie in sub2.xxx.com? ...

Accessing Map value in a separate JSTL loop

Assume that a query result exists called resultSet having a field available as templateId. Also, a map 'templateMap' exists with keys of templatedId. I am not able to get any result from the following, any help appreciated. <c:foreach var="row" items="${resultSet.rows}"> <c:out value="${templateMap[row.templateId]}" /> </c:foreach> ...

File download using Java, Struts 2 and AJAX

Hello Friends, I want to give file download using java,struts2 and ajax. On my html page there is a button called "export" clicking on which ajax call will be made which will execute a query and will create .xls file using code and I want to give that file for download to user without storing it on hard drive. Does any one know how to...

jsps on Tomcats

Hi I have inherited a bit of a messy project in my workplace. It currently runs on Websphere 6.1 but i want to move to Springs TC server offering. 1 particular page in the application is over 2000 lines long (a bit of a mess i know) When i try to access the page on TC server, i get a jasper exception and it complains it cant find the p...

Replace & to &amp; in URLs

I have TONS of XML Parsing Error: EntityRef: expecting ';' errors on my page only because of the incorrect use ampersands in links by the developer. Instead of asking him to use &amp; instead of &, how can I replace those after page load using jQuery? Edit: Ah right, validators read the source so it won't work. Is there any other way ...

Does scriptlet hit the performance in JSP?

Hi I like to know I read all the all the time use JSTL or EL in JSP.. Just curious to know does scriptlet in JSP hit the performance? ...

not display the button in jSP

I want to hide and show the table row based on a condition. The id of my atable row is showhide2. This is my part of code to use show/hide the row <%if(group.equals("Y")){%> <input<% try{if(dTO.getStat() == 0){%> style="display:none;" <%}}catch(Exception ex){} %> type="button" value="View" id="btnview" name="bt...

How to use JSP tags in JavaScript?

How to use JSP tags in JavaScript file? Is there any way? ...

logout with basic authentication without closing webbrowser like banking sites will display

hi, I need to come out of the application after some inactivity session I tried using session.invalidate(); but it is not working as i am using basic authentication and i redirected to JSP page where it asks for login again but it is not asking any login credentials directly logging in to application The only way to logout with basic aut...

Need to call servlet from javascript along with parameters

I have session key that is a javascript variable which i get from a Rest api call. I need to call a servlet and pass that key as a parameter. What Javascript function can I use to do that? ...

Jsp default date format

Is it possible to change default formatting of Date object in JPS pages? Now I have some kind of formatting and I would like to change formatting without using fmt-tags, because that would mean I would have to type that formatting to all pages and there are many! ...

What is the cleanest way to autowire Spring Beans in a JSP?

Hi, We're currently adding some new features to an old webapp which was using only JSP without any framework for the front. We have added Spring recently, and we would like to autowire our beans in our modified JSP, while not rewriting everything to use SpringMVC, Struts2 or Tapestry5. We're using autowiring by type, so it leads to get...

How do I get Eclipse to syntax check inside <%@ include %> directives in JSP?

When I'm using <%@ include %> directives in JSP, is there any way to have Eclipse syntax check my included files (or what is best practice for this). What I mean is that if I include files that have variables declared in the parent, I get a bunch of errors about undeclared variables (makes sense). So how do people get around this? ...