Search Results

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

Page 13/74 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • JSP functions - How to declare long as parameter in TLD

    - by Spines
    I'm getting an error WARNING: Method "pl" for function "pl" not found, I think its because I'm not declaring the parameters right. <function-signature>java.lang.String pl(java.lang.Long, java.lang.String)</function-signature> is what I have in the TLD. and public static String pl(long num, String str) is what I have in the .java file.

    Read the article

  • How to pass checkbox array to Java from jsp

    - by eddy
    Hi, I'd like to know if there's any way to send data to the server for the selected rows using the checkboxes I've put on those rows? I mean , how can I send only the data of those selected rows to the server? Here's the html code I use: <table> <thead> <tr class="tableheader"> <td width="10%"></td> <td width="30%">Vehicle</td> <td width="40%">Driver</td> <td width="10%">Mileage</td> </tr> </thead> <tbody> <c:forEach items="${list}" var="item"> <tr> <td align="center"> <input type="checkbox" name="selectedItems" value="c:out value="${item.numberPlate}"/>"/> </td> <td align="left"><c:out value="${item.numberPlate}"/></td> <td align="left"><c:out value="${item.driver.fullName}" /></td> <td align="left"><input type="text" name="mileage" value="" /></td> </tr> </c:forEach> </tbody> </table> I really hope you can give some guidance on this. Thanks in beforehand.

    Read the article

  • Passing array values using Ajax & JSP

    - by Maya
    This is my chart application... <script type="text/javascript" > function listbox_moveacross(sourceID, destID) { var src = document.getElementById(sourceID); var dest = document.getElementById(destID); for(var count=0; count < src.options.length; count++) { if(src.options[count].selected == true) { option = src.options[count]; newOption = document.createElement("option"); newOption.value = option.value; newOption.text = option.text; newOption.selected = true; try { dest.add(newOption,null); //Standard src.remove(count,null); alert("New Option Value: " + newOption.value); } catch(error) { dest.add(newOption); // IE only src.remove(count); alert("success IE User"); } count--; } } } function printValues(oSel) { len=oSel.options.length; for(var i=0;i<len;i++) { if(oSel.options[i].selected) { data+="\n"+ oSel.options[i].text + "["+ "\t" + oSel.options[i].value + "]"; } } type=document.getElementById("typeId"); type_text=type.options[type.selectedIndex].text; type_value=document.getElementById("typeId").value; } function GetSelectedItem() { len = document.chart.d.length; i = 0; chosen = ""; for (i = 0; i < len; i++) { if (document.chart.d[i].selected) { chosen = chosen + document.chart.d[i].value + "\n" } } return chosen } $(document).ready(function() { var d; var current_month; var month; var str; var w; var sel; var sel_data; var sel_data_value; $('.submit').click(function(){ // to get current month d=new Date(); month=new Array(12); month[0]="January"; month[1]="February"; month[2]="March"; month[3]="April"; month[4]="May"; month[5]="June"; month[6]="July"; month[7]="August"; month[8]="September"; month[9]="October"; month[10]="November"; month[11]="December"; current_month=d.getMonth(); str=month[d.getMonth()]; w=document.chart.periodId.selectedIndex; // to get selected index value.... sel=document.chart.periodId.options[w].text; // to get selected index value text... for(i=sel;i>=1;i--) { alert(month[i]); } sel_data=document.chart.d.selectedIndex; sel_data_value=document.chart.d.options[sel_data].text; var data_len=document.chart.d.length; var j=0; var chosen=""; for(j=0;j<data_len;j++) { if(document.chart.d.options[i].selected) { chosen=chosen+document.chart.d.options[i].value; } } chart = new Highcharts.Chart({ chart: { renderTo: 'container', defaultSeriesType: 'column' }, title: { text: document.chart.chartTitle.value }, subtitle: { text: 'Source: WorldClimate.com' }, xAxis: { categories: month }, yAxis: { min: 0, title: {text: 'Count' } }, legend: { layout: 'vertical', backgroundColor: '#FFFFFF', align: 'left', verticalAlign: 'top', x: 100, y: 70, floating: true, shadow: true }, tooltip: { formatter: function() { return ''+ this.x +': '+ this.y +' mm'; } }, plotOptions: { column: { pointPadding: 0.2, borderWidth: 0 } }, series: [{ name: sel_data_value, data: [50, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] }, { name: 'New York', data: [83.6, 78.8, 98.5, 93.4, 106.0, 84.5, 105.0, 104.3, 91.2, 83.5, 106.6, 92.3] }, { name: 'London', data: [48.9, 38.8, 39.3, 41.4, 47.0, 48.3, 59.0, 59.6, 52.4, 65.2, 59.3, 51.2] }, { name: 'Berlin', data: [42.4, 33.2, 34.5, 39.7, 52.6, 75.5, 57.4, 60.4, 47.6, 39.1, 46.8, 51.1] }] }); }); }); </script> <%! Connection con = null; Statement stmt = null; ResultSet rs = null; String url = "jdbc:postgresql://192.168.1.196:5432/autocube3"; String user = "autocube"; String pass = "autocube"; String query = ""; int mid; %> <% ChartCategory chartCategory = new ChartCategory(); chartCategory.setBar_name("vehicle reporting"); chartCategory.setMonth("3"); chartCategory.setValue("1000"); if (request.getParameter("mid") != null) { mid = Integer.parseInt(request.getParameter("mid")); } else { mid = 0; } Class.forName("org.postgresql.Driver"); con = DriverManager.getConnection(url, user, pass); System.out.println("Connected to Database"); stmt = con.createStatement(); rs = stmt.executeQuery("select code,description from plant"); %> </head> <body> <form method="post" name="chart"> <fieldset> <legend>Chart Options</legend> <br /> <!-- Plant Select box --> <label for="hstate">Plant:</label> <select name="plantId" size="1" id="plantId" > <!--onchange="selectPlant(this)" --> <% while (rs.next()) { %> <option value="<%=rs.getString("code")%>"><%=rs.getString("description")%></option> <% } String plant = request.getParameter("hstate"); System.out.println("Selected Plant" + request.getParameterValues("plantId")); %> </select> <br /> <label for="hcountry">Period</label> <select name="periodId" id="periodId"> <option value="0">1</option> <option value="1">2</option> <option value="2">3</option> <option value="3">4</option> <option value="4">5</option> <option value="5">6</option> <option value="6">7</option> <option value="7">8</option> <option value="8">9</option> <option value="9">10</option> <option value="10">11</option> <option value="11">12</option> </select> <br/> <!--Interval --> <label for="hstate" >Interval</label> <select name="intervalId" id="intervalId"> <option value="day">Day</option> <option value="month" selected>Month</option> </select> </fieldset> <fieldset> <legend>Chart Data</legend> <br/> <br/> <table > <tbody> <tr> <td> &emsp;<select multiple name="data" size="5" id="s" style="width: 230px; height: 130px;" > <% String[] list = ReportField.getList(); for (int i = 0; i < list.length; i++) { String field = ReportField.getFieldName(list[i]); %> <option value="<%=field%>"><%=list[i]%></option> <% //System.out.println("Names :" + list[i]); //System.out.println("Field Names :" + field); } %> </select> </td> <td> <input type="button" value=">>" onclick="listbox_moveacross('s', 'd')" /><br/> <input type="button" value="<<" onclick="listbox_moveacross('d', 's')" /> &emsp; </td> <td> &emsp; <select name="selectedData" size="5" id="d" style="width: 230px; height: 130px;"> </select></td> <% for (int i = 0; i <= 4; i++) { String arr = request.getParameter("selectedData"); System.out.println("Arrya" + arr); } %> </tr> </tbody> </table> <br/> </fieldset> <fieldset> <legend>Chart Info</legend> <br/> <label for="hstate" >Type</label> <select name="typeId" id="typeId"> <option value="" selected>select...</option> <option value="bar">Bar</option> <option value="pie" >Pie</option> <option value="line" >Line</option> </select> <br/> <label for="uname" id="titleId">Title </label> <input class="text" type="text" name="chartTitle"/> <br /> <label for="uemail2">Pin to Dash board:</label> <input class="text" type="checkbox" id="pinId" name="pinId"/> </fieldset> <input class="submit" type="button" value="Submit" /> <!--onclick="printValues(s)"--> </form> <div id="container" style="width: 800px; height: 400px; margin: 0 auto"> </div> </body> </html> using javascript function, am storing the selected listbox values in 'sel_data_value'. I need to pass this selected array values to database to retrieve values regarding selection. How can i do this using ajax. i don know how to pass array values in ajax and retrieve it from database. Thanks.

    Read the article

  • creating a thread in jsp and using join has problem

    - by Suresh S
    guys the following code does not wiat for the thread t to complete and join with the main thread, also the "created object" trace is called one more time after join is called please let me know the solution <% AProc empList = new AProc(); System.out.println("** Created Object ****"); System.out.println("Condition"+(!(p.length==0) && !(status) && !(threadLive))); if (!(p.length==0) && !(status) && !(threadLive)){ java.util.Date currDate = new java.util.Date(); try { Thread t = new Thread(empList); System.out.println("Check thread life 1 "+t.isAlive()); empList.setServletRequest(request , schemaName); System.out.println("Thread Started "+t); t.start(); System.out.println("Check thread life 2 "+t.isAlive()); if(t.isAlive()) { threadLive = true; } t.join(); while (t.isAlive()) { t.join(); } System.out.println("Check thread life 3 "+t.isAlive()); System.out.println("Thread End "+t); //} } catch (Exception e) { System.out.println("Exception in thread while running Procedure "+e); status=false; threadLive=false; } status = e.getStatusProc(); }%>

    Read the article

  • JSP Iterating over a map of a list when the value might be null

    - by Brian Hoover
    How do I clear the value from the stack of a s:iterator? I'm trying to iterator over a TreeMultimap with a structure like: TreeMultimap<person, lineItems> persons; Using something like: <s:iterator value="attendeesForParticipantTypeEvents.asMap()"> <div> <s:property value="key.name" /><br /> <s:iterator id="currentSku" value="value"> <s:property value="currentSku.name" /><br /> </s:iterator> </div> </s:iterator> This works fine, except when the treeMultimap has null for lineItems, then it's taking the value from the previous iteration. So, a structure like: persons = {{"Person1",["Line1","line2"]}, {"Person2",["Line3","line4"]}, {"Person2",null}} Renders as: <div> Person1<br /> Line1<br /> Line2<br /> </div> <div> Person2<br /> Line3<br /> Line4<br /> </div> <div> Person3<br /> Line3<br /> Line4<br /> </div> Which seems to indicate that the value isn't being cleared on each iterator. What do I need to do to handle the case where value might be null? Thanks for your help

    Read the article

  • java jsp : connecting to sql server tutorial?

    - by phill
    Can anyone recommend a tutorial on how to write a java servlet which connects to ms sql server and manages data? I'm trying to write something which pulls products out of one database and inserts them into a stored procedure located on another database. thanks in advance

    Read the article

  • Query in data population using select in jsp

    - by sarah
    I am populating data using <select name="test"> <option value='<%=session.getAttribute("tList")%>'><%=session.getAttribute("tList") %></option> </select> but the values are getting display in a single row in the combo box not row wise,where i am going wrong ?

    Read the article

  • if a JAR is placed on app servers's classpath how do we reference it from JSP

    - by Omnipresent
    On our application we are getting an error saying: PWC6117: File "/struts-tags" not found code in the file thats giving error is: <%@ taglib prefix="s" uri="/struts-tags" %> This file is in struts2-core.jar which is placed on the classpath of the app server (Sun 9.1). The code will work fine and not complain when the jar is actually in WEB-INF/lib of the application, compared to being on classpath of the appserver. But we can not change that. it has to be on appservers classpath. But how should we change our code so that this error goes away? I can create mapping in my web.xml so that tag uri's are change. but what should taglib-location be changed to? so that it references to app servers classpath? <taglib> <taglib-uri>/WEB-INF/struts-tags.tld</taglib-uri> <taglib-location>/WEB-INF/struts-tags.tld</taglib-location> </taglib>

    Read the article

  • Creating a page selector with JSP/JSTL

    - by zakSyed
    I am working on a project where I am required to build a page somewhat similar to the one you see when you visit a website like blockbuster. When you click on browse more you are taken to a page with a bar on top with different page numbers and a drop down to select the number of pages you want to view on that page. I want to include a feature like that on my page but I am not sure where to start. In my page I have list of 200 items which I want to display page by page. I was suggested to use custom tags, but is there a more simpler or efficient way to create that functionality. My web application uses Spring MVC framework and is coded entirely in Java. Any suggestions will be appreciated.

    Read the article

  • How do i loop an ajax request (using jquery) and jsp

    - by Mrshll187
    <script> //when page is ready do the following $(document).ready(function() { //set interval of refresh setInterval(doAjaxMethod, 1000); }); function doAjaxMethod(id) { $.ajax({ url: "getStatus/"+id, dataType: "json", success: function(json) { $('#ajaxStatus').html(json.status); } }); </script> <% //How can I do something like this int n = object.size(); for(int i=0; i<n; i++) { doAjaxMethod(object.getId()); } %> <div id=ajaxStatus> status updates here </div>

    Read the article

  • How to Load external Div that has a dynamic content using ajax and jsp/servlets ?

    - by A.S al-shammari
    I need to use ajax feature to load external div element ( external jsp file) into the current page. That JSP page contains a dynamic content - e.g. content that is based on values received from the current session. I solved this problem , but I'm in doubt because I think that my solution is bad , or maybe there is better solution since I'm not expert. I have three files: Javascript function that is triggered when a element is clicked, it requests html data from a servlet: $("#inboxtable tbody tr").click(function(){ var trID = $(this).attr('id'); $.post("event?view=read",{id:trID}, function(data){ $("#eventContent").html(data); // load external file },"html"); // type }); The servlet "event" loads the data and generates HTML content using include method : String id = request.getParameter("id"); if (id != null) { v.add("Test"); v.add(id); session.setAttribute("readMessageVector", v); request.getRequestDispatcher("readMessage.jsp").include(request, response); } The readMessage jsp file looks like this: <p> Text: ${readMessageVector[0]} </p> <p> ID: ${readMessageVector[1]} </p> My questions Is this solution good enough to solve this problem - loading external jsp that has dynamic content ? Is there better solution ?

    Read the article

  • Why does the JSF action tag handler in JSP invoke rendering immediately after creation?

    - by Pentius
    Dear fellows, I read the article "Improving JSF by Dumping JSP" from Hans Bergsten. There I read the following: The JSP container processes the page and invokes the JSF action tag handlers as they are encountered. A JSF tag handler looks for the JSF component it represents in the component tree. If it can't find the component, it creates it and adds it to the component tree. It then asks the component to render itself. and furthermore On the first request, the action creates its component and asks it to render itself. I understand that the immediate rendering after the creation of the component is the problem here (The reference to the input component can't be resolved in the example). That's one point, why JSF doesn't fit with JSP. But it reads as if the action tag handler itself would ask the component to render. Or is it JSP that triggers the rendering directly after the action tag handler created the component. If it is the action tag handler, I don't understand, why this is the fault of JSP. What is different here than from JSF intended? Thanks for your help, I need this for my thesis.

    Read the article

  • How to store the result of a JSP in a string?

    - by Spines
    I want to store the result of a JSP in a string. For example, I want to be able to call a function like: String result = ProcessJsp("/jspfile.jsp"); Also, this must be rather efficient. Making a url request to the jsp and then storing it would definitely be too slow. How could I do this? Here are my thoughts on how to do this, though I'm not sure if it would work, and I'm hoping there is something simpler: Do RequestDispatcher("/jspfile.jsp").include(hreq, hresp), but instead of putting the real HttpResponse object in there, you put your own where the getWriter() method returns something that writes to your String or a memory buffer, etc.

    Read the article

  • Pass page scope attributes to a JSP using pagecontext.include for use in JSTL?

    - by hal10001
    We're using this JSP template solution almost verbatim at work: http://java.sun.com/developer/technicalArticles/javaserverpages/jsp_templates/ When it gets JSP pages to be included, it uses pageContext.include, which leaves us with one problem, and that is that we have a lot of scriplet code that gets initialized in the JSP itself (tag soup). My thought was to modify the template tag with an additional attribute that is a package path reference to a class with an init or execute method. That execute would get called first, and would add page context attributes before including the JSP. We would then use JSTL to access those attributes. However, I was told this wouldn't work because of how pageContext.include works, and the inability to pass through attributes scoped to the page. Is that true, and are there workarounds? I'm so-so on knowing all my scoping rules.

    Read the article

  • How to read in the XML file on a remote website using JSP?

    - by Alex
    Hi, I'm using java servlets and jsp in my application and I need to read the remote XML file and properly render it into HTML and display on a web page...What is the technology used for reading process?Should I use HTTPURLConnection class to read the contents of the xml file or there is some other way? And also,if I use servlet as a controller and JSP as a view,what would be the responsibility of servlet and jsp in this process?Should servlet just read the whole XML file and then just pass the read output to JSP which will just print it and render properly using XSL for example? I really hope to hear from any people who may help, With kind regards

    Read the article

  • How to terminate a request in JSP (not the "return;")

    - by Genom
    I am programming a website with JSP. There are pages where user must be logged in to see it. If they are not logged in, they should see a login form. I have seen in a php code that you can make a .jsp page (single file), which checkes, whether the user is logged in or not. If not it will show the login form. If the user is logged in, nothing will be done. So in order to do that I use this structure in my JSPs: Headers, menus, etc. etc... normal stuff which would be shown such as body, footer to a logged in user. This structure is very easy to apply to all webpages. So I don't have to apply checking algorithm to each webpage! I can simply add this "" and the page is secure! So my problem is that if the user is not logged in, then only the log in form should be shown and the footer. So code should bypass the body. Therefore structured my checklogin.jsp so: If user is not logged in show the login form and footer and terminate request. The problem is that I don't know how to terminate the request... If I use "return;" then only the checklogin.jsp stops but server continues to process parent page! Therefore page has 2 footers! (1 from parent page and 1 from checklogin.jsp). How can I avoid this? (There is exit(); in php for this by the way!) Thanks for any suggestions!

    Read the article

  • showmodaldialog function in ie8

    - by naweli
    i have written a showmodaldialog() fuction in a jsp file and its working well in firefox but in ie8 its now working,my code is here : <-----a.jsp------ <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"% Step Editor function test() { var retvalue; retvalue = window.showModalDialog("index.jsp"); } <--------- in the above code a.jsp is parent window which is calling index.jsp as child window. <----index.jsp-----

    Read the article

  • Glassfish: Storing Java classes in the docroot folder?

    - by Tom Marthenal
    I'm very new to using Glassfish or JSP. I have this working in NetBeans (which has Glassfish bundled) but when I try to put it on my server which is running Glassfish Server, I really don't know what I'm doing. I can place a JSP file in "domains/domain1/docroot/index.jsp" and it will work when I visit my site, but I can't, for some reason, get Java classes to work. I copied the files in "/build/web/" from the NetBeans project to the docroot folder on my server. The errors I get when I visit the site are: org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP PWC6199: Generated servlet error: string:///index_jsp.java:7: package test does not exist PWC6197: An error occurred at line: 5 in the jsp file: /index.jsp PWC6199: Generated servlet error: string:///index_jsp.java:52: cannot find symbol symbol : class TestClass location: class org.apache.jsp.index_jsp PWC6197: An error occurred at line: 5 in the jsp file: /index.jsp PWC6199: Generated servlet error: string:///index_jsp.java:52: cannot find symbol symbol : class TestClass location: class org.apache.jsp.index_jsp The actual Java class is in "WEB-INF/classes/test/TestClass.class" (it is pre-compiled). I really have no idea what I'm doing wrong so any help is greatly appreciated. Thanks!

    Read the article

  • Learning MVC for a JSP Resource and ASP.Net WebForms Resource

    - by Lijo
    Statement from a colleque: - "People with ASP.Net WebForms skills should be able to learn it easily as the fundamental concept is same.” Consider two people –one from JSP background and other from ASP.Net WebForms background. Now both need to learn ASP.Net MVC in RAZOR. Do you think the person from ASP.Net Webforms background has significant advantage over the person from JSP background? My feeling is – it is equally difficult for JSP person and ASP.Net Webforms person to learn MVC with RAZOR. What is your take on it? Any statistics that you can provide for this?

    Read the article

  • JSP: How can I still get the code on my error page to run, even if I can't display it?

    - by Josh Hinman
    I've defined an error-page in my web.xml: <error-page> <exception-type>java.lang.Exception</exception-type> <location>/error.jsp</location> </error-page> In that error page, I have a custom tag that I created. The tag handler for this tag e-mails me the stacktrace of whatever error occurred. For the most part this works great. Where it doesn't work great is if the output has already begun being sent to the client at the time the error occurs. In that case, we get this: SEVERE: Exception Processing ErrorPage[exceptionType=java.lang.Exception, location=/error.jsp] java.lang.IllegalStateException I believe this error happens because we can't redirect a request to the error page after output has already started. The work-around I've used is to increase the buffer size on particularly large JSP pages. But I'm trying to write a generic error handler that I can apply to existing applications, and I'm not sure it's feasible to go through hundreds of JSP pages making sure their buffers are big enough. Is there a way to still allow my stack trace e-mail code to execute in this case, even if I can't actually display the error page to the client?

    Read the article

  • Development deployment: how to achive edit-and-reload with JSP pages?

    - by doublep
    Out project uses WebLogic as web-server and uses mostly JSP for user interface. With standard setup it is possible to copy edited JSP files into the exploded deployment directory and WebLogic will automatically pick them up, recompile and serve new content through HTTP. However, is it possible to avoid copying at all, so that I just save a file in my editor and it is immediately (well, after a couple of seconds for recompilation) visible? The project uses Apache Ant as building tool. I would imagine what I want would be possible with symlinks (since this is for deployment only I don't care about cross-platformity), but then I don't see how it is possible to symlink lots of files at once with Ant. So, how do I achieve save-JSP-hit-F5-in-browser functionality either with some setting in WebLogic; or with symlinking JSPs using Apache Ant (instead of copying them as is done now); or something else completely?

    Read the article

  • hi when i write <h:outputText value="Login Name"/> tag in my jsp i am getting Cannot find FacesConte

    - by Sunny Mate
    hi when i write <h:outputText value="Login Name"/> tag in my jsp i am getting "Cannot find FacesContext" error , with out that tag my jsp working fine here is my JSP <%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <body> Login Name <input type="text" value=""/><br> **<h:outputText value="Login Name"/>** Password<input type="password" value=""/><br> <input type="submit" value="Login"> </body> </html>

    Read the article

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