jsp

Struts 2 development with Dreamweaver

Does anyone here use Dreamweaver for Struts development? I've been working on a web application using Eclipse/vi, but want to use Dreamweaver so that I can apply some nice looking Dreamweaver templates. I looked for tutorials on Struts development with Dreamweaver, but couldn't find any, and when I tried to import my page, a lot of stuff...

How to make the value in dropdownlist not change after submit in JSP?

Let's say i have a jsp page which contains a dropdownlist. when user select a item and click submit to submit the JSP page to itself, after that , the JSP page will reload and item selected before will disselected. How can i make it not change even after reload the JSP page? ...

Hi, what's wrong about request.getSession().setAttribute()

I use to pass data between *.java and *.jsp, since this is a MVC framework, it will go by the *.java first. so i used request.getSession().setAttribute("test", "01010101010") to save the value, and then in *.jsp, use request.getSession().getAttribute("test") to get value. But it returns a strange string "682342348" all the time. what's U...

Display form-processing results on current page in JSP

Currently I'm able to send some form data from an HTML page to a Servlet, process it, and return the result by forwarding/redirecting to a displayresults.jsp page; However I'm wondering if there's a way to process a form submission in this fashion and then return the results to the initial page? So that whatever I wish to return shows up...

regex for that excludes matches within quotes

I'm working on this pretty big re-factoring project and I'm using intellij's find/replace with regexp to help me out. This is the regexp I'm using: \b(?<!\.)Units(?![_\w(.])\b I find that most matches that are not useful for my purpose are the matches that occur with strings within quotes, for example: "units" I'd like to find a way...

How to draw graphs in JSP

Hi,i want to create graphs with values from database in JSP.i use applet plug in but it does not work well because it araise exceptions when i passed parameters.Pls help me. ...

How to indent jsp pages in eclipse

just started working with jsps and my pages look awful. Please suggest a way to have them indented. thanks ...

jsp error when using if-else with html

I have the following in my jsp page (assume that client is an object ) <% if( client == null) %> NO client <% else %> <a href='page.jsp?aid=<%=client.getID()%>'> and his name is <%=client.getName()%> thanks ...

Displaying image in HTML and JSP code

How can I display image from database in HTML and JSP code? I wrote this code in JSP. <?xml version="1.0" encoding="UTF-8" ?> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <%@ page language="java" %> <%@ page import="java.sql.*" %> <%@ page import="java.io.*" %> <%@ page import="java.util.*"%> ...

Newbie question about Java

Okay, I know that Java is a language but somebody has asked me if they can write a web application to interface in with a web app I've written in ASP.NET. I'm implementing a web service to serve up an XML so it's pretty language agnostic. However, I'm not 100% sure whether going down the Java route makes a lot of sense. I was kind of ex...

upload file in JSP - how to change a default path for the uploaded file

I have two jps pages to handle an upload of the single file. Here is a code for selecting a file: org.apache.commons.io.FilenameUtils, java.util.*, java.io.File, java.lang.Exception" %> ... <form name="uploadFile" method="POST" action="processUpload.jsp" enctype="multipart/form-data"> <input type="file" name="myfile"><br...

Pass a parameter from one jsp to another using form.action

I have an ID that I need in the next jsp once the user click a button. I am trying to do the following: FirstJSP.jsp: function getSecond() { var frm = document.getElementById("frm"); frm.action = "**second.jsp?id=myId;"** frm.submit(); } ... form id="frm" ..... input type="button" v...

Migrating from Velocity to JSPs

As part of a project I'm working on, we're migrating from Velocity to JSP. I need to turn the set of existing Velocity templates into JSPs. We could spend hours discussing why this was decided (partly my fault), which one is better and the best way to dissuade management from this path, but that would be a waste of time as they are commi...

Code Formatter: cleaning up horribly formatted jsp code

So I am working on a jsp/servlet that came to me and I'm looking at the jsp file and it is just a jungle of jstl tags, java code and html thrown together. At first it looked like someone ran the standard eclipse formatter on it and had the page width set to 40 so alot of stuff is broken up, I tried to format it with a larger page width b...

How do I dump a variable in JSP?

I am currently attempting to modify some open source software in JSP and am unaware of the syntax. How does one dump a complex variable to the browser using JSP? ...

How to change date to the format of Mysql in Jsp?

In a Jsp I've got a input date String formatting as “Aug-6-2009”,how to change that to "2009-08-06" so that Mysql can read. Maybe i need regex? That may seem to be a easy question,but bear with me. ...

How / when to delete a file in java?

The problem is, user clicks a button in JSP, which will export the displayed data. So what i am doing is, creating a temp. file and writing the contents in it [ resultSet >> xml >> csv ], and then writing the contents to ServletResponse. After closing the respons output stream, i try to delete the file, but every time it returns false. ...

CAS Single Sign Out requests being ignored by JSP+Spring

I've set up CAS for single sign on with my Spring+JSP webapp, but now I've found out that single sign out isn't actually logging me out of the applications. I've confirmed that if I go to the CAS logout page, I do receive a SAMLP logout request from CAS. When I go back to a secured page in the app, however, I get in without logging back ...

Automatically include a JSP in every JSP

Hi all, I would like to simplify my JSP's even further by transparently including them. For instance, this is the line I would like to remove: <%@ include file="/jsp/common/include.jsp"%> The include.jsp file basically declares all the tag libraries I am using. I am running this on WebSphere 6.0.2 I believe and have already tried t...

How to Properly Escape Triply Nested Quotes in JSP

We just upgraded Tomcat and the newer Tomcat doesn't like nested quotes in the tag, so we have to alternate between single and double quotes. For example, We used to have, <form id="search" action="<fmt:message key="search.url"/>"> Now we can change it to, <form id="search" action="<fmt:message key='search.url'/>"> What should I d...