jsp

Jquery: post data to a jsp method?

I am currently a asp.net guy, but have to do some jsp work now. I know that in asp.net, you can define a public static method with [WebMethod] attribute e.g. [WebMethod] public static string GetIt(string code) { return GetSomething(code); } then, I can call this mehtod in jquery $.ajax({ type: "POST", url: "PageName.a...

Help on a NullPointerException error

I have been trying to modify the following code in JSP from here: ArrayList arrayList=new ArrayList(); String = "tagToFind"; Node n = node.getParentNode(); String printOut = ""; while (n != null && !n.getNodeName().equals(tagToFind)) { n = n.getParentNode(); } if (n.getNodeValue() != null){ arrayList.add(n.getNodeValue()); ...

How we call logout servlet on browser close event

I m making an application in which i want to handle close event of any browser when user clicks on close (X) button of any browser then i want to call my logout servlset then how we handle it. ...

How to print the value of an attribute in jsp/dom

I'm trying to print out an attribute value with the following code: ArrayList arrayList=new ArrayList(); String = "tagToFind"; Node n = node.getParentNode(); String printOut = ""; while (n != null && !n.getNodeName().equals(tagToFind)) { n = n.getParentNode(); } if (n != null){ arrayList.add(n.getNodeValue()); out.prin...

How to call a method in the bean when a JSF page is requested?

How to call a method in the bean when a JSF page is requested? Example I have a JSF page "MyPage.jsf" and its backend bean "MyBean" and it has a method "myMethod()". Is it possible to call the MyBean.myMethod() when MyPage.jsf is requested? ...

Converting an arraylist to a normal array

I was wondering if anyone would be able to show me how to convert an arraylist to normal array in Jsp? ...

Intermittent Tomcat ClassNotFoundException for some jsp pages

Hi guys, We have two tomcat servers load-balanced behind apache. Several times now we'e gotten reports of a 500 error on a page. Checking shows the following error, but only on one of the tomcats: java.lang.ClassNotFoundException: org.apache.jsp.jsps.userLogin_jsp at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at j...

Using java servlets and page attributes with jQuery and javascript

Currently I am using java servlets to set up Hashmaps, lists, and range of business objects and then pass them to a jsp page via request.setAttribute("myMap", myMap); How can I directly access this data in javascript/jquery? What is the syntax ? At the moment I am using jstl and EL expressions to loop through data and set the values of...

how to draw chart using open flash chart2 in jsp

hi plz help me for this!! ...

Random double-quote character in jsp output

I have a .jsp page I'm compiling with ant and deploying to a Tomcat 7 server. A couple of times the output source document has a double-quote character added at a point where it shouldn't be added. It seems to persist through multiple compiles and deploys, but they've always gone away after a while. Here is a section of the jsp: <for...

Using AJAX When Processing JSP Form?

I am just learning how to use JSP and am stack on a small issue. I am creating a basic form where the user inputs some text and then when they submit the form it gets sent to a JSP page. The JSP then outputs what the user inputted using the request.getParameter() call. Now this works fine but i would like the data to be sent to a JSP pa...

How to hide password in a url

There is a JSP script for login to a Server. Currently user credentials are being accepted through HTTP Header and the login.jsp file is so designed that once the user provides credentials the user is redirected to a redirectURL which is a fully qualified URL containing Username and Password in query string and hence the user is able to ...

Using JSP to download a file

I am currently trying to use JSP to build some small litle apps and have not got stuck on something, downloading files from a webserver. I just cant seem to work out how I should go about this task. Are there any JSP developers here who know to go about this and could point me in the right direction? ...

Working with JSP plus Wicket

It is a good choice to use JSP with Wicket at long term? There is also another tool that allows to work with Wicket? Thanks ...

Why is my Java JOX parser servlet failing to convert from bean to string?

Currently working through a tutorial on JOX included within Sams Teach Yourself JavaServer Pages 2.0 with Apache Tomcat in 24 Hours Either the com.wutka.jox has changed or the author missed a crucial ingredient. When I try to execute: java "hu/flux/xml/XMLTestClient" "http://localhost:8080/SamsTeachYourselfJSP/joxparse" "d:\education\...

Page stops rendering

Hello there, i have a JSP page that surprisingly stops rendering when its deployed to a server.But when i place javascript alert() at different positions on that page the page starts rendering as it should.Eventually , when i remove those alerts the page keeps on rendering.When i run that page on my eclipse as localhost it runs fine and ...

How to chain JSP response to Servlet request

I have a situation where I have to generate a lot of HTML and then return it as a string JSONP style. So the eventual HTTP response will actually be javascript text like this: myglobaljavascriptcallbackfunction('<HTML here>'); Since the HTML is complex, the only sane way to construct it is with a JSP. So what I would like to do is take...

Parsing a CSV File In JSP

I am creating a webApp that will download some data from Yahoo Finance into a CSV file and then (hopefully) be able to then read the created CSV data into a HTML table. I have successfully got the program to connect to the Yahoo feed and then download that data into a CSV file and would not like to use the data from the file into a tabl...

Close jsp using Servlet

Hi, My requirement is on clicking a button in a jsp page, it should call another jsp page and that jsp page should get some details and revert back to the first jsp page. I tried calling another jsp page using the following code : window.showModalDialog('stopwarn.jsp', 'dialogHeight:500px; dialogWidth:500px', '') Both jsp pa...

JSP calling a function from another jsp file

Hi i have a JSP file , while trying to add code i got the 64k limit error. so i decided to add the code to another jsp file and include it inside the first one. so i have first.jsp ..... <jsp:include page="second.jsp"/> .... <%= foo(); %> second.jsp .... <%! public String foo() { return "test"; } >% i try using this and i ge...