Search Results

Search found 1850 results on 74 pages for 'jsp'.

Page 1/74 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • passing valus to one jsp page to another jsp page

    - by devuser
    I'm retrieving values from database to table in jsp.(to a column) I want to insert that value into another table in database. To do that i'm using another jsp table to insert that value in db and i call that jsp page in my previous jsp's page form action tab. I use request.getParameter() method to get the values in my first jsp page to new jsp page.but i couldnt get that values using request.getParameter(). How can i solve this

    Read the article

  • Java (JSP): repeating the contentType header in a "sub-jsp"

    - by Webinator
    What happens when headers are repeated in a .jsp you include in another .jsp? For example if example.jsp starts with this: <?xml version="1.0" encoding="UTF-8"?> <jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page"> <jsp:directive.page contentType="text/html; charset=UTF-8" /> <div class="content"> <jsp:include page="support-header.jsp"/> ... (it includes support-header.jsp) And then support-header.jsp starts also with this: <?xml version="1.0" encoding="UTF-8"?> <jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page"> <jsp:directive.page contentType="text/html; charset=UTF-8" /> ... Is that a problem? Is it bad practice? What does concretely happen when you repeat several times a header that only corresponds to one header in the resulting .html page?

    Read the article

  • JSP Include: one large bean or bean for each include

    - by shylynx
    I want to refactor a webapp that consists of very distorted JSPs and servlets. Because we can't switch to a web framework easily we have to keep JSPs and Servlets, and now we are in doubt how to include pages into another and how to setup the use:bean-directives effectively. At the first step we want to decouple the code for the core-actions and the bean-creation into servlets. The servlets should forward to their corresponding pages, which should use the bean. The problem here is, that each jsp consists of different sub- and sub-sub-jsp that are included into another. Here is a shortend extract (because reality is more complex): head header top navigation actionspanel main header actionspanel foot footer Moreover each jsp (also the header and footer) use dynamic data. For example title and actionspanel can change on each page-reload or do have links and labels that depend on the processing by the preceding servlet. I know that jsp-include-directives should only be used for static content und should be avoided for dynamic content. But here we have very large pages, that consist of many parts. Now the core questions: Should I use one big bean for each page, so that each bean holds also data for header and footer beside its core data, so that each subsequent included jsp uses the same bean-directive? For example: DirectoryJSP <- DirectoryBean CompareJSP <- CompareBean Or should I use one bean for each jsp, so that each bean only holds the data for one jsp and its own purpose. For example: DirectoryJSP <- DirectoryBean HeaderJSP <- HeaderBean FooterJSP <- FooterBean CompareJSP <- CompareBean HeaderJSP <- HeaderBean FooterJSP <- FooterBean In the second case: should the subsequent beans be a member of the corresponding parent bean, so that only the parent bean is attached as attribute to the request? Or should each bean attached to the request?

    Read the article

  • Accessing Request object from custom JSP tags

    - by Byron
    I'm trying to make a set of custom tags that encapsulate form elements (markup and validation). There's a method given to retrieve the "Out" object easily: JspWriter out = getJspContext().getOut(); However I can't figure out how to get the request object. I want to be able to directly access the submitted form values from within the Tag class so that I can validate each field. The documentation is quite sparse, so I thought maybe I could use the JspContext object to somehow get the request attributes. But I don't understand the different scopes. System.out.println(getJspContext().findAttribute("field1")); always prints "null". Enumeration e = getJspContext().getAttributeNamesInScope(1); Looping through and printing out the enumeration just gives me a list of classes that don't exist: javax.servlet.jsp.jspOut javax.servlet.jsp.jspPage javax.servlet.jsp.jspSession javax.servlet.jsp.jspApplication javax.servlet.jsp.jspPageContext javax.servlet.jsp.jspConfig javax.servlet.jsp.jspResponse javax.servlet.jsp.jspRequest So is this even possible? If not, could anyone point me to a tag library that deals with form display and validation? I searched the internet for a couple hours and it seemed every single one was discontinued and I couldn't download them. Either that or suggest a better alternative for handling forms.

    Read the article

  • Are JSP and Java still relevant?

    - by dyyyy
    I've been working so long in java and jsp, that for me it's a no-brainer to use it. But now as I'm starting to do my own framework for web applications, I'm wondering if jsp is the right choice. Seing how much php is popular (as well as other languages as ruby and python) Is JSP still a relevant language. Does it have any clear advantage over other languages ? I don't want to use it just because i know it better. So please considering I know nothing, is there a reason to use JSP and JAVA? Thank you

    Read the article

  • Evaluate dynamically constructed JSP at runtime

    - by Sandy
    I have a requirement where in the JSP page itself is created by the user and stored in the database. When viewing results we need to render this JSP to the client, evaluating all tags inside this JSP. I am aware that it is doable as OpenCMS and Blogger both implement this functionality. But, I just can't find the right way. Any pointers on how to do this? [Added] Note: I cannot write a temporary file on disk for the purpose :(

    Read the article

  • Enabling tag libraries in jsp

    - by noam
    I feel like I am missing something - from what it seems, jsp comes out of the box with support for tags, as this question's answer shows (the guy was asking a pure-jsp question and got an answer involving tags). But if I try to run the given code <c:out value="${myString}"/> (with myString defined before, of course), the jsp just writes the above line into the html. Do I have to do something extra to enable it?

    Read the article

  • doubt in JSP:Include

    - by raja
    Hi All: I have added a code which will include child jsp using jsp:include. The problem i am facing is that the code present in child code is not executing. Below is the code iam using it now JSPF File: <jsp:include page="X.jsp" flush="true"> </jsp:include> the above code is present in a file named "A.jspf" which is included in another jsp file named "Parent.jsp". X.jsp: <%@ page import="java.util.*" %> <% System.out.println("********Child JSP"); %> Whenever i execute the parent file "Parent.jsp", all the other contents given in Parent.jsp and A.jspf is displaying except the content present in X.jsp. No error is displaying. Both X.jsp and A.jspf are present in same folder only. Please help me to resolve this issue. Thanks in advance.

    Read the article

  • Passing Textbox values from one JSP to another JSP

    - by Malathy
    hi all. I want to pass a textbox value from source JSP file to the destination JSP file on a href click event withour using javascripts. can anyone help me out in this? i tried using the following method but iam getting error like "End tag is required" <a href="/destinationFile.jsp?sDate=<%='+txtDate.value+' %>"> thanks in advance Malathy.L.

    Read the article

  • Phishing attack stuck with jsp loginAction.do page?

    - by user970533
    I'm testing a phishing website on a staged replica of an jsp web-application. I'm doing the usual attack which involves changing the post and action field of source code to divert to my own written jsp script capture the logins and redirect the victim to the original website. It looks easy, but trust me, it's has been me more then 2 weeks and I cannot write the logins to the text file. I have tested the jsp page on my local wamp server it works fine. In staged, when I click on the ok button for user/password field I'm taken to loginAction.do script. I checked this using the tamper data add-on on Firefox. The only way I was able to make my script run was to use burp proxy intercept the request and change action parameter to refer my uploaded script. I want to know what does an loginAction.do? I have googled it - it's quite common to see it in jsp application. I have checked the code; there is nothing that tells me why the page always points to the .do script instead of mine. Is there some kind of redirection in Tomcat? I like to know. I'm unable to exploit this attack vector? I need the community's help.

    Read the article

  • Difference between $ and # in ADF/JSF/JSP

    - by pavan.pvj
    Found this one interesting. So, picked it from one of the books and posting here.JSP 2.1 and JSF 1.2 - both of them use a unified Expression language. One major and the most obvious difference is between $ and #. JSP 2.1 uses $ and JSF 1.2 uses # in an EL. $ - immediate evaluation# - deferred evaluation$ - $ syntax executes expressions eagerly/immediately, which means that the result is returned immediately when the page renders.# - # syntax defers the expression evaluation to a point defined by the implementing technology. In general, JSF uses deferred EL evaluation because of its multiple lifecycle phases in which events are handled. To ensure the model is prepared before the values are accessed by EL, it must defer EL evaluation until the appropriate point in the life cycle.Note: This is picked up from Oracle Fusion Developer Guide (ISBN: 9780071622547). There is also a very good article here:http://java.sun.com/products/jsp/reference/techart/unifiedEL.html

    Read the article

  • JSP Custom Tag Library vs JSP2 Tag Files

    - by Vinayak.B
    Can anybody gimme the idea about the JSP custom tag library and the JSP 2 Tag files.. Are this two are alternatives to use....??? If there is any comparision(or merits and demerits) among this please do specify.. And which one of this is better to work with.. I m waiting for the kind suggestions.. Regards, Vinayak

    Read the article

  • Uploading a zip file to a jsp and extract the content in another jsp

    - by sunnyj
    I want to upload a zip file in a jsp page and the user is sent to another jsp page after he selects and uploads the file. In this second page I want to 1.)extract the uploaded zip file. 2.)read some content from the extracted file(s) and allow the user to change/edit them 3.)save the user changes in the files. 4.)zip the files again and save it in another destination. Please suggest me a rough outline of a solution as I am stuck in the phase in which I get the uploaded file and re-direct the user to the second jsp.

    Read the article

  • JSP: accessing enum inside JSP EL tags

    - by Arjun
    My java enum looks like this: public enum EmailType { HOME, WORK, MOBILE, CUSTOMER_SERVICE, OTHER } In JSP, I am trying to do sth like below, which is not working. <c:choose> <c:when test="${email.type == EmailType.HOME}">(Home)</c:when> <c:when test="${email.type == EmailType.WORK}">(Work)</c:when> </c:choose> After googling, I found these links: Enum inside a JSP. But, I want to avoid using scriplets in my JSP. How can I access the java enum inside EL tag and do the comparision?? Please help.

    Read the article

  • java - useBean in jsp and getAttribute in jsp but NULL

    - by ravi parekh
    user is null in servlet. Pls let me if doing mistake. i m trying to get all html element in bean rateCode.jsp **<%@page import="com.hermes.data.RateCode_" %>** <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Rate Code</title> </head> <body> **<jsp:useBean id="user" class="com.hermes.data.RateCode_" scope="session" > <jsp:setProperty name="user" property="*"/></jsp:useBean>** <form id="f_rateCode" action="/ratePromoCodes" method="post" > <table align="center" border="1" cellspacing="0"> <tr> <td colspan="2" align="center" class="header">Rate Code Administrations</td> </tr> <tr> <td align="right" style="border-style: solid;">Rate Code:</td> <td align="left" style="border-style: solid;"> <input type="text" id="code" name="code" value="${user.code}" size="10" maxlength="32" style="width: 100px"/> </td> </tr> <tr> <td align="right" style="border-style: solid;">Rate Description:</td> <td align="left" style="border-style: solid;"> <input type="text" id="description" name="description" value="<%=user.getDescription()%>" maxlength="128" size="40"></td> </tr> <tr><td><input type="submit" value="ok" /></td> </tr> </table> </form> Servlet - ratePromoCodes protected void doPost(HttpServletRequest req, HttpServletResponse resp) { RateCode rc = (RateCode) req.getAttribute("user"); Enumeration an = req.getAttributeNames(); Enumeration pn = req.getParameterNames(); Object o = null; while (an.hasMoreElements()) { o = an.nextElement(); System.out.println(o); } while (pn.hasMoreElements()) { o = pn.nextElement(); System.out.println(o); } } RateCode.java (javaBean) public class RateCode_ { private String code ; private String description; public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } }

    Read the article

  • Checking attribute exists in JSP

    - by Javi
    Hello, I have some classes which extends a superclass, and in the JSP I want to show some attributes of these classes. I only want to make one JSP, but I don't know in advance if the object has an attribute or not. So I need a JSTL expression or a tag which checks that the object I pass has this attribute (similar to in operator in javascript, but in the server). <c:if test="${an expression which checks if myAttribute exists in myObject}"> <!-- Display this only when myObject has the atttribute "myAttribute" --> <!-- Now I can access safely to "myAttribute" --> ${myObject.myAttribute} </C:if> How can I get this? Thanks.

    Read the article

  • JSP tag lifecycle

    - by mkoryak
    i just introduced a bug into my code because i seem to have misunderstood the jsp tag lifecycle. The tag worked like this before the bug: i pass the tag some collection as an attribute, and it displays it as a table. The collection was passed into the JSP from the controller. after the bug: a removed the attribute which set the collection. instead, in the tag i check if the collection is null, and then grab it by name from the request (using a naming convention). the thing that i didnt expect: after the collection was initially set in the tag, it would never become null on subsequent executions! it was still defined as an non-requred attribute in the TLD. I expected the tag to not hold on to previous values between executions.

    Read the article

  • Java (JSP/Servlet): equivalent of getServletContext() from inside a .jsp

    - by Webinator
    How should I access the ServletContext from a .jsp? For example, how can I call the getRealPath method from inside a .jsp. Here's a Servlet, which works fine: protected void doGet( HttpServletRequest req, HttpServletResponse resp ) throws ServletException, IOException { resp.setContentType( "text/html; charset=UTF-8" ); final PrintWriter pw = resp.getWriter(); pw.print( "<html><body>" ); pw.print( getServletContext().getRealPath( "text/en" ) ); pw.print( "</body></html>" ); pw.flush(); pw.close(); } Now I'm looking for the exact line I'm supposed to insert in the following .jsp to do exactly the same thing as the servlet above is doing. <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <body> ... // What should I insert here </body> </html>

    Read the article

  • WebSeal and jsp content updated by Ajax

    - by lior chaga
    Hey, I have a problem running an application on environment with WebSeal. It is a web application with Java server that contains many parts that are replcaed within the page according to user input. For instance - a form called Outer.jsp may contain a form:options combo-box (by spring-forms), that uppon selection of an option, a certain Div is updated with a content produced by a jsp and fetched by an Ajax call (the ajax impementation in the client is done by Prototype JavaScript framework 1.5.1.2). Let's call the content fetched by ajax - Inner.jsp So Outer.jsp is fetching Inner.jsp, which in turn uses js functions in files included by the Outer.jsp. This, I think, is where my problem starts - Inner.jsp is not familiar with any of the functions included in Outer.jsp. And so, almost any operation performed by Inner.jsp is failing miserably. Needless to say - this works perfect when running on environment without WebSeal. Note that the scripting is enabled in WebSeal junction (with the -J option). I also see that the content returned by the Ajax call includes a document.cookie added by WebSeal (not sure it matters to this problem) Can anyone assist? Thanks! Lior

    Read the article

  • JSP Content Issue in Tomcat

    - by gautam vegeta
    There is one application where I work where there are still manual builds used i.e manually moving the servlet classes and jsp files from Dev to QA and finally to Prod. This is the method used in this application which cant be changed for some wierd reasons.BTW this is not the problem. We did a manual build where we transferred jsp files from QA to PROD recently. And we noticed that the jsp file content does not correspond to the updated jsp's but have the same content to the jsp file which was present in the server prior to the deployment. We did not re-start tomcat since jsp files upon updation automatically changes its contents. This problem persisted even after 6 hours of deployment If we consider the time standards which are different which may cause some delay. So to fix this we had to individually go into every jsp file and just type something save it and delete this change and save it.Then it worked perfectly. But finally the jsp file content before and after was never changed we just did this to change the modification date. If we think in terms of timestamp problem how can this be possible coz the old jsp files which were present in the server prior to deployment was atlest one month old and the ones getting deployed were defenitely newer than that. Why did this happen? This did not happen when we did same type of deployments earlier. How can we prevent this from happening in the future.

    Read the article

  • Jsp page getting called from cache rather than getting loaded from server

    - by sam4u-optimistic86
    I am calling a jsp based on 2 parameters which is passed from jsp 1 in this way.Below i pass 2 parameters into 2.jsp and based on these 2 parameters data is displayed in 2.jsp.I have a loop in which i have a number of hrefs like the one i have described below.Each of these href passes a different set of value to 2.jsp. out.println("<a href=\"2.jsp?prId=" + prog.getId() + count + "\">" + prog.getName() + "</a>"); I retrieve these 2 parameters in 2.jsp using the following lines count_id = request.getParameter( "country_id" ); prog_id = Integer.parseInt(request.getParameter( "program_id" )); Based on these 2 parameters i show the corresponding data in 2.jsp Now i have a back button in 2.jsp and i call 1.jsp in 2.jsp using the following code <a href="1.jsp"><img src="/image/back.gif" border="0"></a> The problem is when i use the back button and go back to 1.jsp and select another href like the one i have described above i get the data related to the previous href selected. I guess the problem is when i request the page is loaded from cache rather than from the server. Please advice

    Read the article

  • Including a JSP Page Programatically

    - by Tom Tucker
    I need to include a JSP page in a Tag class. I believe the standard way to include a JSP page within another JSP page using API is this: request.getRequestDispatcher("included.jsp").include(request, response); However, I noticed that the included page is rendered at the top of the generated page, no matter where the code is located. On the other hand, the <jsp:include> action works as expected, rendering the included page where the tag appears in the JSP file. How do I include a JSP page in a class so that it behaves the same as the <jsp:include>? There's no way to invoke the <jsp:include> action within a Tag class, is there?

    Read the article

  • Multiple possible jsp views for a request

    - by Karl Walsh
    I'm looking to offer the user some way of changing how a single page looks based on some pre-defined jsps. i.e. Two or more jsp's contain similar information, and would be backed by a single controller method. The controller would decide which view to return. Is there a common way of achieving this? At the moment I have some administration screens where I control a list of possible views. The user can then choose which one to see from a drop-down. My current issue is that I don't know how to confirm (at the admin screen) that the view is valid. Is there a way of asking spring for all possible views so I can filter them and resent a drop-down on the admin screen rather than a free text field? If not is there a way of asking spring if a single view is valid? All these views will reside under a common directory, so it would probably be possible to scan recursively from that point and build a list of possible views. This goes beyond simply changing the css, since the page content might be different despite being backed by the same model.

    Read the article

  • After Filter redirects to login.jsp, proper servlet doesnt get called

    - by gnomeguru
    My simple project structure is shown in this link. I am using Eclipse and Tomcat 6. There is login.jsp which submits its form to login_servlet. The login_servlet sets a session variable and then redirects to home.jsp. The home.jsp file has links to the 4 JSP files under a directory called /sam. In web.xml I have given the url-pattern as /sam/* for the LogFiler filter. The LogFilter just reads the session variable and does doChain(request,resposne) if valid, else it redirects to /login.jsp. RequestDispatcher rd = request.getRequestDispatcher("/login.jsp"); rd.forward(request,response); Basically I don't want anyone to access files inside /sam directory directly. Now let's say, I try to directly access a file inside /sam directory, the filter kicks in and the redirection to login.jsp works and even the broswers contents are that of login.jsp, but the url in the browser doesn't change. When I enter details and press submit, instead of sending the data to login_servlet, it sends it to sam/login_servlet and then tomcat tells me there is no such servlet here! Obviously there isn't. My doubt is why is it sending it so sam/login_servlet instead of /login_servlet which is usually what it does when I start running the login.jsp on my own. One more thing, is there a way I can apply the servlet to ONLY .jsp files inside /sam diectory? I tried giving the url-pattern like /sam/*.jsp, but Tomcat was refusing to accept that url-pattern.

    Read the article

  • Is there any specific available method in jsp/Servlet API which tell you from which page the request

    - by anubhavjain86
    Hi, I have been working in Oracle iStore from past 4 months and i have been managing the application without any IDE (basically doing all the chores on notepad only because application has been designed poorly and no IDE can support it). Since the coding is done on simple notepad files it is very hard to find out the bugs in the application. I am facing a problem that i have not idea which jsp page redirect the control to which jsp page. For instance, there are two jsp pages A.jsp and other is B.jsp. Now the browser is currently displaying A.jsp. When the user click on submit button (available on A.jsp) the form submits and redirects the control to B.jsp. Now my problem is that i know i am coming on B.jsp but, i don't know that A.jsp is redirecting the control to B.jsp. Is there an method available in Servlet API which tells Which jsp is redirecting the control to B.jsp? Sorry for making you read so much long story :( appreciate ur help in advance Best Regards Anubhav

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >