jsp

JSP/Javascript/JQuery: store html/javascript content in a variable + write it to textarea

Hello, I'm using a json object to store different bits of content, one of which can contain javascript & html relevant content (like quotes, semicolons, tags etc) which without encoding can break the page. To work around this I'm using: "content":"<%=StringEscapeUtils.escapeHtml(StringEscapeUtils.escapeJavaScript(content))%>" (I'm usi...

How to save user's choice of theme of web pages

I have a simple web app, it's done with several JSP pages. I would like to add some style to it. I would like to provide some color theme options say like in a drop down box. I have little basic knowledge of CSS. Here are my questions: I think I should have all styles in one CSS file, and use format like selector#different_ids {propert...

Turn off selected HTML errors in eclipse

I recently upgraded my Eclipse to Ganymede, version 3.4.2. Now it's giving me a ton of errors on the HTML in my JSPs for things like parameter values with no quotes and missing end tags. These pages work fine because the cases where I leave these things out are cases where they're optional. We can argue about whether I should include th...

Calling executable files from JSP

Hi, Is there anything similar to php's exec() function in jsp? I'm running Websphere App server in my Windows machine. I would like to call some .exe files when a link is clicked in my jsp page. Please tell me if any function is available in jsp that helps in executing an external program. ...

Customizing jsp pages

I would like to let users customize pages, let's call them A and B. So basically I want to provide a hyperlink to a jps page with big text box where a user should be able to enter any text, html (to appear on page A), with ability to preview it and save. I haven't really deal with this sort of issues before and would appreciate help...

JSTL for each problem

Hi all, I have a for each loop that it works fine when the items property is filled using an scriplet in the following way: <% List<LandingCategory> cats = beanFactory.getLandingCategories(); %> <c:forEach var="cat" items="<%=cats%>"> <c:out value="${cat.id}"/> </c:forEach> However, when trying to filled the items list w...

Stack Overflows in the Eclipse JSP Editor

When editing JSPs in Eclipse, I periodically get stack overflows. Once I get one, each time I click a character I get a pop-up telling me there was another stack overflow. This continues until I close the JSP and re-open it, at which time it's fine for a while. org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser: input could...

Dynamically generate JFreeChart in servlet

I'm trying to generate graphs dynamically using JFreeChart as a result of some checkboxes the user selects, but I can't figure out how best to get the generated datasets into chart form (I have code that makes charts from these, but need to produce pngs) and into the JSP view. Currently, I can only think of sending the Datasets to the J...

Java HttpServletRequest get URL in browsers URL bar.

So I'm trying to grab the current URL of the page using Java's request object. I've been using request.getRequestURI() to preform this, but I noticed that when a java class reroutes me to a different page off a servlet request getRequestURI gives that that address as opposed to the orginal URL that was typed in the browser and which stil...

Compiling java code with non java extension file in eclipse

Hi, I am working on a project in which there are jsp files and some files with extension .jsps. And these files only include java snippets in form of <% %> and javascript code. And this .jsps file is included in jsp file. For compiling, eclipse is just ignoring .jsps files. And I want to compile all the files using eclipse version 3.4.1....

How to use SLF4J Loggers in a JSP

I'm in the process of migrating the logging of a middle-sized application from a custom solution to something more standard. I've decided on using Logback and SLF4J, and I have successfully migrated most of the Java code. However, I have quite a bit of JSPs that simply use System.out for logging. I've never worked much with JSPs, and sta...

How do I determine the IP address of a web client (for a JSP)?

I would like to find out the ip address of the client that is visiting my web pages. Content of JSP page: <% out.print( request.getRemoteAddr() + "<br>"); out.print( request.getRemoteHost() ); %> Output: 0:0:0:0:0:0:0:1 0:0:0:0:0:0:0:1 ...

Eclipse "cannot find the tag library descriptor"

I have a JEE project which build fine with Ant, deploys perfectly to JBoss, and runs without any trouble. This project includes a few custom tag libraries, which are also working without any difficulties. The problem is with the Eclipse IDE (Ganymede): in every single JSP file which uses our custom tags, the JSP parser flags the taglib ...

How to change the path of displaytag.properties?

Currently i have placed the Displaytag.properties in 'src' directory, and it is working fine. Is it posssible to have this file on some different location like src/comp/bre/sub/config ? ...

where is the best place to start learning about servlet/tomcat?

I need to start developing using this technology servlets/jsp with tomcat. I need to get up to speed fairly quick. What would you recommend to get up there fairly quick? No 900+ pages manuals. A good tutorial (even a video lectures) with lots of examples would be perfect. Thanks ...

include directive and <jsp:include> attribute name problem

Hi, Why in JSP we write attribute name as file in include directive, but as page standard action? ...

What is the best framework for web-development to start with?

I want to get into web-development and trying to pick a framework to playground with as well as a develop complex web-app. I am considering the following: C# with ASP.NET MVC. Ruby on rails Tomcat/servlets/jsp For now, I am planning to run it on windows, yet might migrate it to Linux. I want to his framework to be fairly intuitive t...

IE8/Firefox Behavioral Difference

I'm working on login page written as a JSP. It's pretty simple but behaves differently in IE8 and Firefox (big surprise there). I have not tested this is other browsers yet. I could probably hack a fix in with some Javascript but I was looking for more information about the behavior, before I just implement a workaround, with hopes of a...

JSP files won't compile - JSPTranslator.CouldNotLoadClass

I have 6 JSP applications running on a Windows Server 2003 box with JRun 4 with Updater 7 and the Java 1.6.0_14. All of my applications are working just fine except for 1 of them and any new ones I create in JRun. I just cannot find where the difference in configuration or permissions is. Whenever I attempt to access a JSP file on the...

Working with errorPage directive with Servlet Filters in Java/JSP

Thanks to everyone in advance, I have overwritten HTTPServletResponse that collects headers and also put together a servlet filter that takes those headers and sets them using their proper methods (example: 500 error code uses response.sendError(500)). I am noticing that when this filter is set in the web.xml, any pages that have the er...