Search Results

Search found 2126 results on 86 pages for 'jsp fragments'.

Page 11/86 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • jsp error plz check this code why are not insert my data into database

    - by lekhni
    <%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> <%@ page import="java.sql.*" %> <%@ page import="java.io.*"%> <%@ page import="java.io.File"%> <%@ page import="java.util.*"%> <%@ page import="java.sql.*"%> <%@ page import="java.sql.Blob"%> <%@ page import="java.sql.PreparedStatement"%> <%@ page import="java.sql.BatchUpdateException"%> <%@ page import="javax.servlet.*"%> <%@ page import="javax.servlet.http.*"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'p.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> </head> <body> <% int activityId = Integer.parseInt(request.getParameter("activityId")); String name = request.getParameter("name"); String activityType = request.getParameter("activityType"); int parentId = Integer.parseInt(request.getParameter("parentId")); String description = request.getParameter("description"); %> <% Connection conn=null; PreparedStatement pstatement = null; try{ Class.forName("com.mysql.jdbc.Driver"); conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/pol","root","1234"); Statement st=conn.createStatement(); String queryString = "INSERT INTO activity(activityId,name,activityType,parentId,description)" + " VALUES (?, ?, ?, ?, ?)"; pstatement = conn.prepareStatement(queryString); pstatement.setInt(1, activityId); pstatement.setString(2, name); pstatement.setString(3, activityType); pstatement.setInt(4, parentId); pstatement.setString(5, description); } catch (Exception ex) { out.println("Unable to connect to batabase."); } finally { pstatement.close(); conn.close(); } %> </body> </html>

    Read the article

  • JSP Custom Taglib: Nested Evaluation

    - by Tiago Fernandez
    Say I have my custom taglib: <%@ taglib uri="http://foo.bar/mytaglib" prefix="mytaglib"%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> <mytaglib:doSomething> Test </mytaglib:doSomething> Inside the taglib class I need to process a template and tell the JSP to re-evaluate its output, so for example if I have this: public class MyTaglib extends SimpleTagSupport { @Override public void doTag() throws JspException, IOException { getJspContext().getOut().println("<c:out value=\"My enclosed tag\"/>"); getJspBody().invoke(null); } } The output I have is: <c:out value="My enclosed tag"/> Test When I actually need to output this: My enclosed tag Test Is this feasible? How? Thanks.

    Read the article

  • Automatically tidy up JSP/JSF files

    - by er4z0r
    Hi, I am working on a webapplication and I do most of the XHTML stuff in an editor. Every once in a while I froget to close a tag or mess up the nesting (we all get distracted sometimes ;-)). So I commpile, package and run my webapp (using maven mvn clean package jetty:run-war only to notice that displaying the view (where I messed up the jsp) fails with an exception while trying to render. So I wondered: Is there some tool that I can include into my build-cycle that automatically catches and rectifies those careless mistakes?

    Read the article

  • JSP Page HttpServletRequest getAttribute Typecasting

    - by MontyBongo
    Hi There, Any ideas on the correct method of typecasting an Object out of a getAttribute request from a JSP page HttpServletRequest? I have googled but it seems that the common solution is just sticking suppresswarnings in your code... Something I would very much like to avoid. I currently have: HashMap<String, ArrayList<HashMap<String, String>>> accounts = (HashMap<String, ArrayList<HashMap<String, String>>>)request.getAttribute("accounts"); And the complier is giving me this warning: Unchecked cast from Object to HashMap Thanks in Advance!! MB.

    Read the article

  • html select option tag closes itself due to a "/" character in the dynamic value (JSP, JSTL)

    - by saky
    <select id="ordersSelect" class="drop-down" onchange="somemethod()"> <c:forEach items="${orders}" var="order" varStatus="orderStatus"> <option value="${order.id}"> ${order.publicId} </option> </c:forEach> </select> I have the above peice of code in a JSP page, that receives a list of Orders and each order has some information, the particular information that I want to display in a SELECT field is the publicId. The problem is that, on display there is only one OPTION in the SELECT and the rest of the order's publicId s are displayed as normal text below the SELECT box and not an OPTION to select. I found out that the publicId actually contains a String like A10/0001/0 and that is the character "/" is most probably causing the problem. Any solutions/suggestion/ideas?

    Read the article

  • unable to start .bat file from JSP

    - by Stardust
    I have a batch file runthis.bat If I double click on this a text file is being created with name dir.txt Now I have to run this batch file using JSP. <% Runtime run =Runtime.getRuntime(); run.exec("C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/try/runthis.bat"); out.println("SUCCESS"); %> I'm getting the output SUCCESS on a webpage but this batch file is not running. Whats might be the problem?

    Read the article

  • Restlets with Google App Engine, Java Server Pages, (JSP's), and Shiro authentication

    - by DutrowLLC
    I'm having difficulty integrating Restlets into my project. I'm using google app engine (GAE) and I also have some java server pages (JSPs) set up. The JSP's never seem to work at the same time as the Restlets, should I only be using one or the other in GAE? I'm also using Shiro (formerly Ki, formerly JSecurity) and I have been unable to get Restlets to work with Shiro's filter for authentication. Are there any issues in particular that I should be aware of? What are other people using to secure restlet apps on GAE? Is Shiro overkill if I just need authentication and some role-based authorization? Thanks so much! Chris

    Read the article

  • where should we place HIDDEN variable in JSP

    - by micheal
    I need to use Hidden variables in my JSP for session tracking. this is the code: <input type="hidden" name="REQ_TOKEN" value="<%=session.getAttribute("SESN_TOKEN").toString()%>" /> i am using this to compare the request token with session token, so only when both are equal i will evaluate that request otherwise i will throw an error. Now the problem is, when i place this code inside <form></form> tags, it is working fine. Unfortunately there are some JSPs in my application where we dont have tag(I know that sounds weird!). where can i place my code so that it will work? Cant i use Hidden variables without FORM tag???

    Read the article

  • Converting a JSP to a SharePoint webpart

    - by Kelly French
    We have a large number of Java based servlets/portlets running in a BEA portal that we want to convert into SharePoint 2007 webparts. Many of the portlets use user preferences but the implementations are split between preferences being handled by the portlet directly and stored in a separate database from the portal. Others are using the BEA WebLogic API for user preferences. Three questions: Has anyone gotten a Java Servlet/JSP (compiled against JRE 1.4.2 and running on Tomcat 4.1) to run as a SharePoint 2007 webpart? How large of an effort was it in general (as in, was it measured in days/weeks/months)? Would it be easier to rewrite the portlet as native webparts at least as far as user preferences are concerned?

    Read the article

  • JSP: EL expression is not evaluated

    - by James
    I have a JSP page running on Tomcat 5.5. I have the following code: <c:forEach var="i" begin="1" end="10" step="1"> <c:out value="${i}" /> <br /> </c:forEach> The output I am getting is: ${i} ${i} ${i} ${i} ${i} ${i} ${i} ${i} ${i} ${i} I cant work out why the forEach loop is working but the output is not working. Any help any one could give would be great.

    Read the article

  • Update MySQL table from jsp

    - by vishnu
    I have these in a jsp file. But these values are not updated in the mysql table. May be it is not commiting. How can i solve this ? String passc1 = request.getParameter("passc1"); String accid = request.getParameter("accid"); int i = 0; String sql = " update customertb " + " set passwd = ?" + " where acc_no = ?;"; try { PreparedStatement ps = con.prepareStatement(sql); ps.setString(1, passc1); ps.setString(2, accid); i = ps.executeUpdate(); } catch (Exception e) { // do something with Exception here. Maybe just throw it up again } finally { con.close(); }

    Read the article

  • Problems with Tomcat server and JSP web application

    - by CitadelCSCadet
    I am running a JSP/Servlet Web application and out of nowhere we experienced some random problems that don't make any sense. I checked the catalina.out file to check the log files, and I noticed it contained some of the following messages SEVERE: Error starting static Resources java.lang.IllegalArgumentException: Invalid or unreadable WAR file : error in opening zip file INFO: validateJarFile(/home/weremo/appservers/ apache-tomcat-6.0.26/webapps /WMA/WEB-INF/lib/ servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class I am aware of what this message means, but am in the dark as to what could have caused it, or what effects it could have on the application.

    Read the article

  • jsp TextField binding

    - by user72185
    I have a panel in my Page1.jsp: <webuijsf:panelLayout binding="#{Page1.dynamicFieldsPanel}" id="dynamicFieldsPanel" -rave-layout: grid"/> Then I have this in Page1.java: private PanelLayout dynamicFieldsPanel = new PanelLayout(); public void setDynamicFieldsPanel(PanelLayout pl) { this.dynamicFieldsPanel = pl; } public PanelLayout getDynamicFieldsPanel() { TextField textField = new TextField(); this.dynamicFieldsPanel.getChildren().add(textField); return dynamicFieldsPanel; } How do I bind my dynamic TextField to something so I can retrieve the value entered by the user?

    Read the article

  • JSP doGet not called from form

    - by RadnaOdela
    I have this code on my JSP page <form action="LoginServlet" method="get"> <input type="text" name="username" /> <input type="text" name="password" /> <input type="submit" value="Submit" /> </form> and when I press Submit I get: The page cannot be displayed The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings. and LoginServlet.doGet method doesn't get called. But then when I press Enter again (in address bar) my doGet method gets called. What is wrong? I am using JEE eclipse and Tomcat

    Read the article

  • load table data on jsp using struts2 with fixed table structure

    - by Zahra
    Hi. I want to have a fixed table structure on my jsp page(3row, 4column). but I want to load data for this table from DataBase with using struts 2. I know if my table structure wasn't fixed I could have just get a List and iterate on it and add a data in every iteration, but how could I do this in this case. also if I don't have enough data to fill table, I want those places to be empty. I didn't find a good example, if you could help me or introduce me a good tutorial, it would be really appreciated. Thanks in advance.

    Read the article

  • Return tiff file from outputstream on JSP

    - by YYY
    I am using a JSP to display a single TIFF file. The flow is as follows: I am given a PDF to convert to a TIFF. I feed a 'black box' API the PDF in the form of a File object and an OutputStream (I am currently using a ByteArrayOutputStream but that can change as needed. The 'black box' converts the PDF to a TIFF and saves the result to the OutputStream. I use out.println(outputstream) to spit out the TIFF. The problem is that I am getting a text stream instead of a displayed image. I have used the following head/meta tag: <head><title>PDF to TIFF tester</title> <META HTTP-EQUIV="Content-Script-Type" CONTENT="image/tiff"></head> <body> But that does not change the end result. Any help?

    Read the article

  • JSP 2.0 SEO friendly links encoding

    - by victor hugo
    Currently I have something like this in my JSP <c:url value="/teams/${contact.id}/${contact.name}" /> The important part of my URL is the ID, I just put the name on it for SEO purposes (just like stackoverflow.com does). I was just wondering if there is a quick and clean way to encode the name (change spaces per +, latin chars removal, etc). I'd like it to be like this: <c:url value="/teams/${contact.id}/${supercool(contact.name)}" /> Is there a function like that out there or should I make my own?

    Read the article

  • JSP property lookup error

    - by AEIOU
    I'm getting the following error in ours logs: Error looking up property "foo" in object type "foo.bar". Cause: null java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor363.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1773) I cannot for the life of me recreate it, I was wondering if anyone has any experience with this kind of problem with JSP/Java Bean. What I wanted to know was, will this prevent the user from getting the web page to show up? I know this isn't a whole lot of information, but any advice could help.

    Read the article

  • JSP Problem ussing implicit object (session) in a function

    - by user234666
    Can the object of type HttpSession called session be accessed from a function? In a simple jsp page I have a function(see below) defined in the header of the page, and set to an onclick handle of for a button. When I press this button, I'll never see the second alert message. If I do something in the body of the page (like Session ID: <%= session.getId() % ) I have no trouble accessing it. What newbie mistake am I making? function doTest() { alert('Preforming test 122333232'); String sessionId = session.getId(); alert('After access'); if(sessionId == null) { alert('session id is null?'); } Thanks

    Read the article

  • Servlet's doGet not called from JSP form

    - by RadnaOdela
    I have this code on my JSP page <form action="LoginServlet" method="get"> <input type="text" name="username" /> <input type="text" name="password" /> <input type="submit" value="Submit" /> </form> and when I press Submit I get: The page cannot be displayed The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings. and LoginServlet.doGet method doesn't get called. But then when I press Enter again (in address bar) my doGet method gets called. What is wrong? I am using JEE eclipse and Tomcat

    Read the article

  • JSP doPost getAtribute null value

    - by newbie123
    I want to pass value to servlet but I keep get null value. <jsp:useBean id="Helper" class="model.Registration" scope="request"/> <form action="/Project/Registration" method="post" enctype="multipart/form-data"> <input type="text" size="20" name="name" value="<%=Helper.getName()%>"> <input type="submit"> </form> protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Registrationh2 = (Registration) request.getAttribute("Helper"); if(h2!=null){ System. out.println(h2.getName()); } else System. out.println("NULL"); } Is there anything wrong with my code?

    Read the article

  • Passing a enum value as a tag attribute in JSP

    - by Jakub
    I have a custom JSP tag which is using a parameter which is an enum. This approach is a consequence of using other classes which need this enumeration. The point is I have no clue how to assign an enum value in the EL: <mytaglib:mytag enumParam="${now what do I type here?}" /> The only workaround which I found so far was to make the enumParam an Integer and convert it to desired values: <mytaglib:mytag enumParam="3" /> I believe there must be a better way to do it. Please help.

    Read the article

  • Printing saved HTML to jsp keeps getting corrupted

    - by JWL
    I have a JAVA object where I save a HTML string value I call message. The saved data looks like the below, You have received a new <a href='' onclick='return popupRentalView('5282053859835904');'>Rental Request 5282053859835904</a>. Please view your open orders. But when printed to the JSP file and displayed at runtime using <%=pm.getMessage()%> or <%out.print(pm.getMessage());%> The actual html code comes out all messed up, You have received a new <a 5282053859835904');'="" onclick="return popupRentalView(" href="">Rental Request 5282053859835904</a> . Please view your open orders. Any thoughts on why the displayed string does not match the saved string? JAVA code for saving is note.setMessage("You have received a new <a href=\"\" onclick='return popupRentalView('" + requestId + "');'> Rental Request " + requestId + "</a>. Please view your open orders.");

    Read the article

  • Jsp cache problem

    - by idiotgenius
    I use javascript and css to build a multi-level drop down menu with following markups: <ul> <li>menu item 1</li> <ul> <li><a href="#">sub menu menu item 1</a></li> ................. This markup is generated by a custom JSTL tag <mui:menu .../> which loads menu data from a database. I hope my jsp page can behave like this: if menu data has not changed since last time I visited the page, just use browser's cache otherwise load from database... How can I do it? I don't know much detail about cache mechanism.

    Read the article

  • Setup Jetty 7 with JSP engine

    - by Justin
    I've been trying to get Jetty to run my web app via a custom launcher (embedded). I am trying to figure out how to tell Jetty which java compiler to use for JSPs. I want to do what java -jar start.jar -OPTIONS=jsp does, but without using start.jar. Here is what shows on the console: Javac exception, Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK Do I need to put the javac libraries into my classpath?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >