jsp

How to generate content based on spring-security user rights.

I want to generate some html content based on the user rights of a user who logged in with spring-security. I can't find much about this subject on the internet so far and i'm wondering what would be a good way to implement this. So far i was thinking about making a custom tag, attach it to a controller who links to a class that can gen...

Data transfer between Servlet and JSP

I have a JSF/JSP page, a managed bean, and a separate file/class that extends HttpServlet with the doPost method. I have a separate test program that sends a xml object to the doPost method via a HttpURLConnection. What is wanted: Start the JSP page with temporary data (works). At a later time, send a new xml object to the doPost met...

Need a CRUD tool to create admin pages for a Tomcat app

For a JSP/Servlet based app (not using any other fancy Java framework) running on Tomcat and accessing data on SQL Server 2008, what the easiest way to create simple admin pages for the database tables with CRUD functionality? ...

how to get an object an invoke a method in jstl EL in a JSP

I'm trying to convert the following scriptlet code to EL. I tried the following (below), but can't get it working. getValue() is a method off of ConfigFactory that returns a string: In a listener, I set the configFactory as event.getServletContext().setAttribute("ConfigFactory", new ConfigFactory()); In my scriptlet code there is: (an...

Apache Forward JSP pages to tomcat

I have Apache Server, in which my website running, but there is some jsp pages in my website. I have to forward my jsp pages and servlet to tomcat. Kindly help me so that I can make it possible. Sorry for my bad English. ...

Call a JSON file in the server in JSP

Hi, everyone, I want to ask some questions about the JSP and JSON file. I have a JSON format file which put in the tomcat server. And I use the JSP to write the web application. When the user types the URL and open the JSP page, the JSP page will get the file in the tomcat server (e.g. it can assume the file in the "c://location"). Aft...

How to retrieve the file in JSON format in JSP?

Hi, everyone, I want to ask a question about the JSON and JSP. I have 2 JSP (JSP1 & JSP2) pages and 1 JSON format file. Both of the JSP pages are pack into a .war file. The JSON file is stored in a web server(e.g. http://examp;e.com). And I have to do the following tasks: 1) Open the JSP1 (has a link) 2) When the user clicks the lin...

window.location and window.open problem

I can't seem to solve this. Originally the JSP code had a function in Javascript that would call a jsp from another server: window.open("<%= otherServer %>/ourreports/Company/fooreport.jsp?index"+index,"Foo",options); where otherServer was a local server (http://192.168.4.40:8080) This worked fine, and would pop out a new window with...

In Spring MVC custom JSP tag: "Cannot find symbol": pageContext

Why would the pageContext variable not be findable in this custom tag installed in the WEB-INF/tags directory of a Spring MVC app? <%@ tag import="com.ocpsoft.pretty.time.PrettyTime, java.util.Date"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ attribute name="dateParam" required="true" type="java.util.Date" %> ...

Why can I not transfer a scriptlet attribute to JSTL in this JSP custom tag?

The string: ${prettyDate} is output to the page by this custom tag instead of the prettified Date string: <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ tag import="com.ocpsoft.pretty.time.PrettyTime, java.util.Date"%> <%@ attribute name="dateParam" required="true" type="java.util.Date" %> <% PrettyTime p = ne...

How to import my imports in JSP?

All of my JSPs have this at the top: <%@ page language="java" isELIgnored="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ taglib prefix="spring" uri="http://www.springfr...

Having Netbeans autodeploy war file to tomcat

Greetings all Currently working on assessing a project, and wondered if there was a way to have it so the war file generated whe the project is built can be autodeployed to a specified directory to be used by tomcat. I'm using netbeans 6.9.1 on ubuntu 10, with tomcat 6, and while I figured there was a way to do this in the application, ...

Is it possible to secure an included jsp with spring-security?

I got a jsp which imports a jsp file. Is it possible to secure the import with a spring-security configuration? For example i want to use this line of code: <c:import url="jsp/admin/add_user.jsp" /> But if the user is not logged in as admin than this import should not work because of security reasons. I secured the admin folder with ...

binding form parameters to a bean using just Servlets and JSP - possible?

I am using Servlet and JSP without a framework to study for my SCWCD. I have a simple form that I want the parameters to bind to a bean automatically. Is this possible without writing binding code or using a framework? Thanks ...

Installing jar file to Tomcat web application

How do I install a 3rd party JAR file to my tomcat web application? I have placed it in every folder I can think of, and am referencing it like: import com.google.api.translate; Is there a particular folder? I have tried WEB_INF/lib ...

unable to display jsp

I am trying to display dynamic data in jsp. for that I am calling java method inside a jsp using jsp expression. this java method is taking much time but it is returning some value.(I cant reduce the method execution time.) But my jsp is showing blank. Can anybody explain what would be the reason and how to resolve. This code is not wri...

Javascript onload in HTML

hi, everyone, I want to ask a question about the javascript "onload". I am writing the JSP page and I use the <%@ include file ="body.jsp". and I use the following statement in the body.jsp. <table onload="function()"> to load a javascript function, but it doesn't have any action of the page. Is the "onload" can only be used in the ...

How to retrieve the content/file in JSP?

Hi, everyone, I have a question about the JSP. I have a JSON file in the server and the content is like the following: { "class": { "number": 2, "student": { "name": "Tom", "age": 1 }, "student": { "name": "May", "age": 2 } } } when I ...

Struts 1: Accessing form values with bean:write

Greetings, This is a simple question I believe, but nonetheless it is stumping me right now. I have a TestForm class with your usual getters/setters...for example I have an "id" field with "getId" and "setId" methods. My form is populated in an action class correctly (which I know from stepping through the Eclipse debugger) just befor...

Is it possible to invoke a Servlet before showing index.jsp

I need to do some pre-processing logic which reside in my Struts2 Action class, before showing index.jsp when user access my Java web application for the first time. I tried using the below snippet in web.xml but it failed: web.xml: <welcome-file-list> <welcome-file>loginPage.action</welcome-file> </welcome-file-list> To summariz...