Search Results

Search found 3678 results on 148 pages for 'jsf jsp el'.

Page 21/148 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Best JSF framework/library for "conversation state"

    - by stacked
    What do people think is the best JSF framework or library for a saving state longer than request scope (but w/o using session scope) that is backbutton/new window safe -- i.e. you have a "wizard"/multi-page form. For example, MyFaces has the 'SaveState' tag (http://bit.ly/8QHmX5) that allows you to maintain state across pages by saving state in the view's component tree. Any comments on SaveState (pros/cons) or suggestions for any better framework or library for this capability?

    Read the article

  • sql report link with rs:Command paramaters not opening in JSF page

    - by H3wh0s33ks
    I have a report that we need to link (which we've checked to be working) to in a JSF project, the link looks like the following: http://www.example.com/report/summary&rs:Command=Render However when we try to load the page that links to it we get the following error: The reference to entity "rs:Command" must end with the ';' How can I link to the report within my pages and prevent it from trying to parse the rs:Command?

    Read the article

  • JSF Data transfer between UI to Business Layers

    - by Ram
    Hi, We are using JSF in UI,Spring in Business Layer,Hibernate in Persistance layer.Now my question is how to pass data from my JSF1.1_01 UI to spring Business Layer.Can I directly used my Business object in my Backed Bean or through DTO should I transfer data between the layer? Can one explain me with clear explanation if possible with piece of code and that related websites?

    Read the article

  • XMLHttpRequest and IE 8 error - in jsp/servlet applicaton

    - by Greener
    Hello, I am using HMLHttpRequest object to retrieve information from the database via servlet and populate combo box. The code run in Firefox 3.6 and Chrome without any problems. However, I have a problem with IE 8. here is my code: var req; var isIE; function initRequest(){ if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { isIE = true; req = new ActiveXObject("Microsoft.XMLHTTP"); } } function populateMuniBox(countyCode) { initRequest(); req.onreadystatechange = populateMuniCallback; req.open("GET","./CntyMuni?county="+ countyCode,true); req.send(null); } function populateMuniCallback() { //clean combo box document.getElementById("cmbMuni").options.length = 0; var muni; if(req.readyState==4){ if (req.status == 200){ var XMLresult = req.responseXML; var muni = XMLresult.getElementsByTagName("rec"); } } for(var i=0;i<muni.length;i++) { //create Html option Element var opt = document.createElement("option"); //Set up the option - add values from XML opt.value = muni[i].getAttribute("code"); opt.text = muni[i].getAttribute("desc"); //add the option to the combobox document.getElementById("cmbMuni").appendChild(opt); } } HMTL code //First combo box the sends a value to the script <td> <select name="cn" id="county" onchange="populateMuniBox(this.value)"> // Second cmb <select name="mu" id="cmbMuni" ></select> IE error: 'lenght' is null or not an object cntymuni.jsp Code: 0 I am not sure how to fix the error.

    Read the article

  • JSP or .ascx equivalent for Scala?

    - by Daniel Worthington
    I'm working on a small MVC "framework" (it's really very small) in Scala. I'd like to be able to write my view files as Scala code so I can get lots of help from the compiler. Pre-compiling is great, but what I really want is a way to have the servlet container automatically compile certain files (my view files) on request so I don't have to shut down Jetty and compile all my source files at once, then start it up again just to see small changes to my HTML. I do this a lot with .ascx files in .NET (the file will contain just one scriptlet tag with a bunch of C# code inside which writes out markup using an XmlWriter) and I love this workflow. You just make changes and then refresh your browser, but it's still getting compiled! I don't have a lot of experience with Java, but it seems possible to do this with JSP as well. I'm wondering if this sort of thing is possible in Scala. I have looked into building this myself (see more info here: http://www.nabble.com/Compiler-API-td12050645.html) but I would rather use something else if it's out there.

    Read the article

  • how to restrict a jsp hit counter?

    - by user261002
    I am writing a hot counter in jsp, for my coursework. I have write the code, and there is not error and its working, but the problem is that: if the user have open the website and try to user different page, when ever that the user get back to the home page the counter still is adding a number , how can I restrict this part??? shall restrict it with session?? this is my code : The current count for the counter bean is: <% counter.saveCount(); int _numberofvisitors=counter.getVisitorsNumber(); out.println(_numberofvisitors); % Bean: package counter; import java.sql.*; import java.sql.SQLException; public class CounterBean implements java.io.Serializable { int coun = 0; public CounterBean() { database.DatabaseManager.getInstance().getDatabaseConnection(); } public int getCoun() { return this.coun; } public void setCoun(int coun) { this.coun += coun; } public boolean saveCount() { boolean _save = false; database.SQLUpdateStatement sqlupdate = new database.SQLUpdateStatement("counter", "hitcounter"); sqlupdate.addColumn("hitcounter", getCoun()); if (sqlupdate.Execute()) { _save = true; } return _save; } public int getVisitorsNumber() throws SQLException { int numberOfVisitors = 0; if (database.DatabaseManager.getInstance().connectionOK()) { database.SQLSelectStatement sqlselect = new database.SQLSelectStatement("counter", "hitcounter", "0"); ResultSet _userExist = sqlselect.executeWithNoCondition(); if (_userExist.next()) { numberOfVisitors = _userExist.getInt("hitcounter"); } } return numberOfVisitors; } }

    Read the article

  • call lynx from jsp script

    - by Piero
    Hi, I have an execute(String cmd) in a jsp script that calls the exec method from the Runtime class. It works when I call a local command, like a php script stored on the server. for example: /usr/bin/php /path/to/php/script arg1 arg2 So I guess my execute command is ok, since it is working with that. Now when I try to call lynx, the text-based web browser, it does not work. If I call it in a terminal, it works fine: /usr/bin/lynx -dump -accept_all_cookies 'http://www.someurl.net/?arg1=1&arg2=2' But when I call this from my execute command, nothing happens... Any idea why? This is my execute method: public String execute(String cmd){ Runtime r = Runtime.getRuntime(); Process p = null; String res = ""; try { p = r.exec(cmd); InputStreamReader isr = new InputStreamReader(p.getInputStream()); BufferedReader br = new BufferedReader(isr); String line = null; //out.println(res); while ((line = br.readLine()) != null) { res += line; } p.waitFor(); } catch (Exception e) { res += e; } System.out.println(p.exitValue()); return res; }

    Read the article

  • JSTL Session Lookup - Key Has Periods

    - by John W.
    Hello All, I am working with some legacy code, and at some point there is a key in the session that is something like session.setAttribute("com.org.something.Object",someObject); Now trying to access this in a jsp using jstl is a bit difficult becuase if I tried it like I normally would I would do: ${sessionScope.com.org.something.Object.someFieldGetter} As most of us can imagine it will fail because there is no com object in session scope. I also tried ${sessionScope.'com.org.something.Object'.someFieldGetter} And a parsing error was thrown. Does anyone know how to resolve this so that I can correctly get the object similar to session.getAttribute("com.org.something.Object") but through jstl? thank you.

    Read the article

  • Jsp static import

    - by folone
    I've created a Spring Roo project. Everything looks fine. Now I want to add a form with a text input and a button to my index.jspx. This form will change a static field currentUser in my ToDo class. So I'm adding: <form> <%@ page import="static com.mypack.domain.ToDo.*" %> <label for="_username_id">My name is:</label> <% currentUser = request.getParameter("username"); %> <input type="text" id="username" name="username" maxlength="30" path="username" size="0" value="<%= currentUser %>"/> <input type="submit"/> </form> somewhere in the middle of it. And now it won't work: This page contains the following errors: error on line 6 at column 20: StartTag: invalid element name Below is a rendering of the page up to the first error. function readCookie(name) { var nameEQ = name + '='; var ca = document.cookie.split(';'); for(var i=0;i If I comment the lines above, it works just fine. What is wrong? Is there a way to write a value to a static field of a class from a jsp page? How do I work around this?

    Read the article

  • JSP Upload File Java.lang.NullPointer

    - by newbie123
    I want to develope upload and download file from server. Upload.html <form action="/UploadFile/UploadFile" method="POST" enctype="multipart/form-data">Select a file: <input type="submit" name="button" /> <input type="file" name="first"></form> UploadFile.servlet protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String temp = request.getParameter("first"); System.out.println(temp); File origFile = new File(temp); FileOutputStream out = new FileOutputStream(request.getContextPath() + "pdtImages/" + "FirstFile"); InputStream ins = new FileInputStream(origFile); try { System.out.println(request.getContextPath()); byte[] buf = new byte[1024]; int len; while ((len = ins.read(buf)) > 0) { out.write(buf, 0, len); } out.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } When I submitted the file I got null pointer error message. I not very familiar with jsp can anybody help me? I want to store the file to the server directory.

    Read the article

  • Passing dynamic string in hyperlink as parameter in jsp

    - by user3660263
    I am trying to pass a dynamic string builder variable in jsp I am generating a string through code. String Builder variable has some value but i am not able to pass it in at run time.It doesn't get the value. CODE FOR VARIABLE <% StringBuilder sb=new StringBuilder(""); if(request.getAttribute("Brand")!=null) { String Brand[]=(String[])request.getAttribute("Brand"); for(String brand:Brand) { sb.append("Brand="); sb.append(brand); sb.append("&&"); } } if(request.getAttribute("Flavour")!=null) { String Flavour[]=(String[])request.getAttribute("Flavour"); for(String flavour:Flavour) { sb.append(flavour); sb.append("&&"); } sb.trimToSize(); pageContext.setAttribute("sb", sb); } out.print("this is string"+sb); %> CODE FOR HYPERLINK <a href="Filter_Products?${sb}page=${currentPage + 1}" style="color: white;text-decoration: none;">Next</a></td>

    Read the article

  • XML Doc to JSP to TIFF

    - by SPD
    We have around 100 word templates, every time user gets a business request he goes into shared folder select the template he/she wants and enter information and save it as tiff, these tiffs later processed by some batch program. I am trying to automate this process. So I defined an XML which has Template information like <Template id="1"> <Section id="1"> <fieldName id="1">Date</fieldName> <fieldValue></fieldValue> <fieldtype></fieldType> <fieldProperty>textField</fieldProperty> </Section> <Section id="2"> <fieldName id="2">Claim#</fieldName> <fieldValue></fieldValue> <fieldtype></fieldType> <fieldProperty>textField</fieldProperty> </Section> </Template> Based on the template values I generate the JSP on fly. Now I would like to generate a TIFF file out of it in specified format. I am not sure how to handle this requirement. *edited the original question.

    Read the article

  • Cannot connect to MySQL server using JSP

    - by Dibya
    I just set foot on JSP. I started writing simple programs to display dates, system info. Then I tried to connect a MySQL database I have a free hosting account, but I am not able to connect to MySQL database. Here is my code: <%@ page import="java.sql.*" %> <%@ page import="java.io.*" %>  <html> <head> <title>Connection with mysql database</title> </head> <body> <h1>Connection status</h1> <% try { String connectionURL = "jdbc:mysql://mysql2.000webhost.com/a3932573_product"; Connection connection = null; Class.forName("com.mysql.jdbc.Driver").newInstance(); connection = DriverManager.getConnection(connectionURL, "a3932573_dibya", "******"); if(!connection.isClosed()) out.println("Successfully connected to " + "MySQL server using TCP/IP..."); connection.close(); }catch(Exception ex){ out.println("Unable to connect to database."); } %> </font> </body> </html> I am getting Message as Connection Status unable to connect to database. I have tested this connection using PHP using the same username, password and database name. Where am I making mistake?

    Read the article

  • password is auto-completed despite setting redisplay=false in JSP (Struts)

    - by lmcgowin
    So I have a web application on Tomcat, built on top of Struts 1.1. Here is a snippet of my JSP, it's a login. <html:form action = "LoginAction" focus = "username"> <table> <tr><td align = "right">User name: </td> <td><html:text property = "username"/> </td></tr> <tr><td align = "right">Password: </td><td><html:password property = "password" redisplay = "false"/></td></tr> </table> </html:form> Snippet from struts-html-1.1.tld: <tag> <name>password</name> <tagclass>org.apache.struts.taglib.html.PasswordTag</tagclass> <attribute> <name>redisplay</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> Resulting HTML: Having trouble getting this to post as code but the relevant part is an input tag of type 'password' with no reference to redisplay, autocomplete, etc. It is my understanding that the redisplay element should be passed through Struts to appear in the HTML.

    Read the article

  • Struts 2: redirect-action ? From on page to another and back again.

    - by Stephan
    Hello, i have a jsp page that has a submit button. This button is linked with another jsp page. So lets assume my stuts file looks like this: B.jsp So now the submit button being on page "A.jsp" will take me to B.jsp. This works. The problem is that i want to do the following: press on the submit button on page A.jsp , go to B.jsp where i will press again a button and go back to A.jsp . The problem is that to page B.jsp go many pages, so B.jsp has to know when pressing the submit button to which page will take me back , in this case A.jsp again. So in a few words, B.jsp has to know from which page i came from so that i can go back again by pressing a submit button (this could be a parameter that would be sent back to A.jsp again, but does not really matter at the current point) A.jsp - B.jsp - A.jsp C.jsp - B.jsp - C.jsp

    Read the article

  • JDBC with JSP fails to insert

    - by StrykeR
    I am having some issues right now with JDBC in JSP. I am trying to insert username/pass ext into my MySQL DB. I am not getting any error or exception, however nothing is being inserted into my DB either. Below is my code, any help would be greatly appreciated. <% String uname=request.getParameter("userName"); String pword=request.getParameter("passWord"); String fname=request.getParameter("firstName"); String lname=request.getParameter("lastName"); String email=request.getParameter("emailAddress"); %> <% try{ String dbURL = "jdbc:mysql:localhost:3306/assi1"; String user = "root"; String pwd = "password"; String driver = "com.mysql.jdbc.Driver"; String query = "USE Users"+"INSERT INTO User (UserName, UserPass, FirstName, LastName, EmailAddress) " + "VALUES ('"+uname+"','"+pword+"','"+fname+"','"+lname+"','"+email+"')"; Class.forName(driver); Connection conn = DriverManager.getConnection(dbURL, user, pwd); Statement statement = conn.createStatement(); statement.executeUpdate(query); out.println("Data is successfully inserted!"); } catch(SQLException e){ for (Throwable t : e) t.printStackTrace(); } %> DB script here: CREATE DATABASE Users; use Users; CREATE TABLE User ( UserID INT NOT NULL AUTO_INCREMENT, UserName VARCHAR(20), UserPass VARCHAR(20), FirstName VARCHAR(30), LastName VARCHAR(35), EmailAddress VARCHAR(50), PRIMARY KEY (UserID) );

    Read the article

  • JMS MQ Connection closed in JSF 2 SessionBean

    - by veote
    I use Websphere Application Server 8 with MQ Series as Messaging Queue. When I open close the connection in sessionbean in a "postConstruct" method and I use it in another method then its closed. My Code is: import java.io.Serializable; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.annotation.Resource; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import javax.faces.context.FacesContext; import javax.jms.JMSException; import javax.jms.Queue; import javax.jms.QueueConnection; import javax.jms.QueueConnectionFactory; import javax.jms.QueueSender; import javax.jms.QueueSession; import javax.jms.Session; import javax.jms.TextMessage; @ManagedBean @SessionScoped public class MQRequest implements Serializable { private static final long serialVersionUID = 1L; @Resource(name = "jms/wasmqtest/wasmqtest_QCF") private QueueConnectionFactory connectionFactory; @Resource(name = "jms/wasmqtest/Request_Q") private Queue requestQueue; private QueueConnection connection; private String text = ""; public void sendMessage() { System.out.println("Connection in sendMessage: \n" + connection); TextMessage msg; try { QueueSession queueSession = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); QueueSender sender = queueSession.createSender(requestQueue); msg = queueSession.createTextMessage(text); sender.send(msg); queueSession.close(); sender.close(); } catch (JMSException e) { // TODO Auto-generated catch block e.printStackTrace(); } text = ""; } @PostConstruct public void openConenction() { System.out.println("Open Connection"); try { connection = connectionFactory.createQueueConnection(); connection.start(); System.out.println("Connection in OpenConnectioN: \n" + connection); } catch (JMSException e) { e.printStackTrace(); } } @PreDestroy public void closeConnection() { try { System.out.println("Closing Connection"); connection.close(); } catch (JMSException e) { e.printStackTrace(); } } public void setText(String text) { this.text = text; } public String getText() { return text; } } In PostConstruct method the connection is initialized: [21.10.13 07:36:05:574 CEST] 00000025 SystemOut O Connection in OpenConnectioN: com.ibm.ejs.jms.JMSQueueConnectionHandle@36c9b1a managed connection = com.ibm.ejs.jms.JMSManagedQueueConnection@3657e8b physical connection = com.ibm.mq.jms.MQXAQueueConnection@36618b6 closed = false invalid = false restricted methods enabled = false open session handles = [] temporary queues = [] But in sendMessage() method it isnt and I get a ConnectionClosed Problem: [21.10.13 07:36:12:493 CEST] 00000025 SystemOut O Connection in sendMessage: com.ibm.ejs.jms.JMSQueueConnectionHandle@36c9b1a managed connection = null physical connection = null closed = true invalid = false restricted methods enabled = false open session handles = [] temporary queues = [] 21.10.13 07:36:12:461 CEST] 00000025 SystemErr R 15 [WebContainer : 3] INFO org.apache.bval.jsr303.ConfigurationImpl - ignoreXmlConfiguration == true [21.10.13 07:36:12:601 CEST] 00000025 SystemErr R javax.jms.IllegalStateException: Connection closed [21.10.13 07:36:12:601 CEST] 00000025 SystemErr R at com.ibm.ejs.jms.JMSConnectionHandle.checkOpen(JMSConnectionHandle.java:821) [21.10.13 07:36:12:601 CEST] 00000025 SystemErr R at com.ibm.ejs.jms.JMSQueueConnectionHandle.createQueueSession(JMSQueueConnectionHandle.java:206) [21.10.13 07:36:12:601 CEST] 00000025 SystemErr R at de.volkswagen.wasmqtest.queue.MQRequest.sendMessage(MQRequest.java:51) [21.10.13 07:36:12:601 CEST] 00000025 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [21.10.13 07:36:12:601 CEST] 00000025 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) [21.10.13 07:36:12:601 CEST] 00000025 SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at java.lang.reflect.Method.invoke(Method.java:611) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at org.apache.el.parser.AstValue.invoke(AstValue.java:262) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at org.apache.myfaces.view.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:83) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at javax.faces.component._MethodExpressionToMethodBinding.invoke(_MethodExpressionToMethodBinding.java:88) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:100) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at javax.faces.component.UICommand.broadcast(UICommand.java:120) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at javax.faces.component.UIViewRoot._broadcastAll(UIViewRoot.java:973) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:275) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1285) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:711) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:34) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1147) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:722) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:449) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1020) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3703) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:953) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1655) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) [21.10.13 07:36:12:605 CEST] 00000025 SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1650) Do you have an idea why the connection is closed?

    Read the article

  • dynamic button in jsp

    - by kawtousse
    hi everyone, in my jsp i have a table constructed dynamically like the following: retour.append("<tr>"); try { s= HibernateUtil.currentSession(); tx=s.beginTransaction(); Query query = s.createQuery(HQL_QUERY); for(Iterator it=query.iterate();it.hasNext();) { if(it.hasNext()){ Dailytimesheet object=(Dailytimesheet)it.next(); retour.append("<td>" +object.getActivity() +"</td>"); retour.append("<td>" +object.getProjectCode() + "</td>"); retour.append("<td>" +object.getWAName() + "</td>"); retour.append("<td>" +object.getTaskCode() +"</td>"); retour.append("<td>" +object.getTimeFrom() +"</td>"); retour.append("<td>" +object.getTimeSpent() + "</td>"); retour.append("<td>" +object.getPercentTaskComplete() + "</td>"); if (droitdaccess) { retour.append(""); retour.append(""); retour.append(""); retour.append("<td bordercolor=#FFFFFF>"); retour.append("<input type=\"hidden\" id=\"id_"+nomTab+"_"+compteur+"\" value=\""+object.getIdDailyTimeSheet()+"\"/>"); retour.append("<img src=\"icon_delete.gif\" onClick=\"deletearowById('id_"+nomTab+"_"+compteur+"')\" style=\"cursor:pointer\" name=\"action\" value=\"deleting\" />"); retour.append("</td>"); } } compteur++; retour.append("</tr>"); } //terminer la table. retour.append ("</table>"); next to the table i want to display a button named send in order to send the table content. I do not really want to dispaly this button where the table is empty. So at least if the table is populated by nly one record i want that button being displayed. How should i deal in this case. Thanks.

    Read the article

  • JSF calls java.net.URLEncoder.encode() method

    - by Ron
    Is there a way to call java method in .xhtml? I just want to be able to call java.net.URLEncoder.encode() method from xhtml file. Is it possible to do this? In jsp it was very easy to do <% String encodedURL = java.net.URLEncoder.encode(url, type); %

    Read the article

  • JSF: Cannot catch ViewExpiredException

    - by ifischer
    I'm developing a JSF 2.0 application on Glassfish v3 and i'm trying to handle the ViewExpiredException. But whatever i do, i always get a Glassfish error report instead of my own error page. To simulate the occurrence of the VEE, i inserted the following function into my backing bean, which fires the VEE. I'm triggering this function from my JSF page through a commandLink. The Code: @Named public class PersonHome { (...) public void throwVEE() { throw new ViewExpiredException(); } } At first i tried it by simply adding an error-page to my web.xml: <error-page> <exception-type>javax.faces.application.ViewExpiredException</exception-type> <location>/error.xhtml</location> </error-page> But this doesn't work, i'm not redirected to error but i'm shown the Glassfish errorpage, which shows a HTTP Status 500 page with the following content: description:The server encountered an internal error () that prevented it from fulfilling this request. exception: javax.servlet.ServletException: javax.faces.application.ViewExpiredException root cause: javax.faces.el.EvaluationException:javax.faces.application.ViewExpiredException root cause:javax.faces.application.ViewExpiredException Next thing i tried was to write ExceptionHandlerFactory and a CustomExceptionHandler, as described in JavaServerFaces 2.0 - The Complete Reference. So i inserted the following tag into faces-config.xml: <factory> <exception-handler-factory> exceptions.ExceptionHandlerFactory </exception-handler-factory> </factory> And added these classes: The factory: package exceptions; import javax.faces.context.ExceptionHandler; public class ExceptionHandlerFactory extends javax.faces.context.ExceptionHandlerFactory { private javax.faces.context.ExceptionHandlerFactory parent; public ExceptionHandlerFactory(javax.faces.context.ExceptionHandlerFactory parent) { this.parent = parent; } @Override public ExceptionHandler getExceptionHandler() { ExceptionHandler result = parent.getExceptionHandler(); result = new CustomExceptionHandler(result); return result; } } The custom exception handler: package exceptions; import java.util.Iterator; import javax.faces.FacesException; import javax.faces.application.NavigationHandler; import javax.faces.application.ViewExpiredException; import javax.faces.context.ExceptionHandler; import javax.faces.context.ExceptionHandlerWrapper; import javax.faces.context.FacesContext; import javax.faces.event.ExceptionQueuedEvent; import javax.faces.event.ExceptionQueuedEventContext; class CustomExceptionHandler extends ExceptionHandlerWrapper { private ExceptionHandler parent; public CustomExceptionHandler(ExceptionHandler parent) { this.parent = parent; } @Override public ExceptionHandler getWrapped() { return this.parent; } @Override public void handle() throws FacesException { for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) { ExceptionQueuedEvent event = i.next(); System.out.println("Iterating over ExceptionQueuedEvents. Current:" + event.toString()); ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource(); Throwable t = context.getException(); if (t instanceof ViewExpiredException) { ViewExpiredException vee = (ViewExpiredException) t; FacesContext fc = FacesContext.getCurrentInstance(); NavigationHandler nav = fc.getApplication().getNavigationHandler(); try { // Push some useful stuff to the flash scope for // use in the page fc.getExternalContext().getFlash().put("expiredViewId", vee.getViewId()); nav.handleNavigation(fc, null, "/login?faces-redirect=true"); fc.renderResponse(); } finally { i.remove(); } } } // At this point, the queue will not contain any ViewExpiredEvents. // Therefore, let the parent handle them. getWrapped().handle(); } } But STILL i'm NOT redirected to my error page - i'm getting the same HTTP 500 error like above. What am i doing wrong, what could be missing in my implementation so that the exception is handled correctly?

    Read the article

  • Handling a Long Running jsp request on the server using Ajax and threads

    - by John Blue
    I am trying to implement a solution for a long running process on the server where it is taking about 10 min to process a pdf generation request. The browser bored/timesout at the 5 mins. I was thinking to deal with this using a Ajax and threads. I am using regular javascript for ajax. But I am stuck with it. I have reached till the point where it sends the request to the servlet and the servlet starts the thread.Please see the below code public class HelloServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("POST request!!"); LongProcess longProcess = new LongProcess(); longProcess.setDaemon(true); longProcess.start(); request.getSession().setAttribute("longProcess", longProcess); request.getRequestDispatcher("index.jsp").forward(request, response); } } class LongProcess extends Thread { public void run() { System.out.println("Thread Started!!"); while (progress < 10) { try { sleep(2000); } catch (InterruptedException ignore) {} progress++; } } } Here is my AJax call <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>My Title</title> <script language="JavaScript" > function getXMLObject() //XML OBJECT { var xmlHttp = false; xmlHttp = new XMLHttpRequest(); //For Mozilla, Opera Browsers return xmlHttp; // Mandatory Statement returning the ajax object created } var xmlhttp = new getXMLObject(); //xmlhttp holds the ajax object function ajaxFunction() { xmlhttp.open("GET","HelloServlet" ,true); xmlhttp.onreadystatechange = handleServerResponse; xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlhttp.send(null); } function handleServerResponse() { if (xmlhttp.readyState == 4) { if(xmlhttp.status == 200) { document.forms[0].myDiv.value = xmlhttp.responseText; setTimeout(ajaxFunction(), 2000); } else { alert("Error during AJAX call. Please try again"); } } } function openPDF() { document.forms[0].method = "POST"; document.forms[0].action = "HelloServlet"; document.forms[0].submit(); } function stopAjax(){ clearInterval(intervalID); } </script> </head> <body><form name="myForm"> <table><tr><td> <INPUT TYPE="BUTTON" NAME="Download" VALUE="Download Queue ( PDF )" onclick="openPDF();"> </td></tr> <tr><td> Current status: <div id="myDiv"></div>% </td></tr></table> </form></body></html> But I dont know how to proceed further like how will the thread communicate the browser that the process has complete and how should the ajax call me made and check the status of the request. Please let me know if I am missing some pieces. Any suggestion if helpful.

    Read the article

  • JSF: initial request and postback request?

    - by Harry Pham
    Please take a look at this below line of code in JSF <h:inputText id="name" value="#{customer.name}" /> Quote from java.sun.com For an initial request of the page containing this tag, the JavaServer Faces implementation evaluates the #{customer.name} expression during the render response phase of the lifecycle. During this phase, the expression merely accesses the value of name from the customer bean, as is done in immediate evaluation. For a postback request, the JavaServer Faces implementation evaluates the expression at different phases of the lifecycle, during which the value is retrieved from the request, validated, and propagated to the customer bean. I am not sure I understand initial request vs postback request. Does the client browser make two different request to the webserver?

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >