Search Results

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

Page 40/148 | < Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >

  • spring faces without spring flow

    - by AgostinoX
    I'm starting a new JSF (2) project. I realize that pure JSF has some limitation and I'm planning to drop in spring. JSF is a relatively new approach in spring (there is not even a tag spring-faces in stackoverflow :-) ), jsp being the classic way. I need the best available adjustment of the technology stack. 1) do i need to use spring web flow too? 2) is it viable to use just spring faces (that seems to come as a part of web flow) + spring mvc+ JPA? 3) is there any good example of such a configuration?

    Read the article

  • Server-initiated Rendering: EJB -> FacesContext?

    - by egbokul
    I've already asked this question on the Icefaces forum, but meanwhile I realized that this is a more generic problem. I'd like to update parts of a JSF page when I get a message in my MDB. The problem is, how do I get the FacesContext from the EJB container? In the message processing function FacesContext.getCurrentInstance() returns null. I've also tried to make a JSF managed bean be a MDB, but I couldn't (it seems you can't have both in the same class?). Since I'm a beginner in the JSF world I'm kind of stuck now. Is there a way to make it work? (Glassfish v3 + Netbeans 6.8, JSF2 + Icefaces 2.0 alpha2)

    Read the article

  • how to use jquery autocomplete?

    - by kyrogue
    hi, i am creating a web project using JSP, and is trying to implement a simple search for users from my database using jquery autocomplete, however i am having trouble understanding how it works. i have little to no knowledge on jquery and ajax just to let you know. i have done the following code and am stuck. <%@page contentType="text/html" pageEncoding="UTF-8" import="ewa.dbConnect,ewa.sendEmail,ewa.pwGen,ewa.hashPw,java.sql.*" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="css/jquery.autocomplete.css" /> <script src="js/jquery.autocomplete.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <input type="text" id="search" name="search"/> <script> $("#search").autocomplete("getdata.jsp"); </script> </body> </html> <%@page contentType="text/html" pageEncoding="UTF-8" import="ewa.dbConnect,java.sql.*" %> <%! dbConnect db = new dbConnect(); %> <% String query = request.getParameter("q"); db.connect(); Statement stmt = db.getConnection().createStatement(); ResultSet rs = stmt.executeQuery("SELECT username FROM created_accounts WHERE username LIKE "+query); while(rs.next()) { out.println(rs.getString("username")); } db.disconnect %> if i am not wrong i read from a website, the parameter q is default and is just there, however how do i display the data? how do i pass the values from getdata.jsp into the autocomplete?

    Read the article

  • onselect in one combo it changes data dynamically in other combo?

    - by ajay
    Hello sir I am new to the jsp and ajax world. my problem is If i select one combo option then it should change the other combo options dynamically without submit button press. for example if i select the country then it should shows their states in other combo. I am using servlet & JSP and MS-ACCESS as backend. please reply as soon as possible. THANKING YOU....

    Read the article

  • How to call a javascript function from a servlet?

    - by sunnyj
    I submit a (jsp) form to a Servlet A. Then I handle some logic which would make the submission either a success or a failure. I use jquery's ajaxForm() function to re-direct the user to a different jsp after the Servlet logic is executed. But before this redirection happens I need to show a javascript notification showing whether the submission was successful or not. Can someone tell me how can I do this?

    Read the article

  • How to improve multi-threaded access to Cache (custom implementation)

    - by Andy
    I have a custom Cache implementation, which allows to cache TCacheable<TKey> descendants using LRU (Least Recently Used) cache replacement algorithm. Every time an element is accessed, it is bubbled up to the top of the LRU queue using the following synchronized function: // a single instance is created to handle all TCacheable<T> elements public class Cache() { private object syncQueue = new object(); private void topQueue(TCacheable<T> el) { lock (syncQueue) if (newest != el) { if (el.elder != null) el.elder.newer = el.newer; if (el.newer != null) el.newer.elder = el.elder; if (oldest == el) oldest = el.newer; if (oldest == null) oldest = el; if (newest != null) newest.newer = el; el.newer = null; el.elder = newest; newest = el; } } } The bottleneck in this function is the lock() operator, which limits cache access to just one thread at a time. Question: Is it possible to get rid of lock(syncQueue) in this function while still preserving the queue integrity?

    Read the article

  • Page Refresh problem

    - by Abhi
    I have a jsp in which there are certain buttons when i am clicking on one of those, the page is refreshing but the problem is that I want to show that section of jsp where the button is on which the user has done the on click event...but the section which is coming is the top of the page but I don't want that. Please provide me with a solution to rectify the situation.

    Read the article

  • url redirection

    - by psdesai
    Hi, I need some help with regards to the url redirection. Here is the problem. We have a website with a section as http://www.site.com/sectionxxx/index.jsp we have another domain http://www.sectionxxx.com. The task is to forward any request comming for the http://www.sectionxxx.com; direct to http://www.site.com/sectionxxx/index.jsp. Any idea? P

    Read the article

  • security issue on web application using firebug

    - by Suresh S
    Guys i have developed a web application in jsp . I have many javscript validation for text validation in the jsp page.while during the testing , i enabled firebug in firefox and cleared a function that validates and submits to a servlet.The web application allows to submit garbage value of the textfiedl . how to overcome this ? any solutions?

    Read the article

  • Fetching data from the other sites and displaying into our page.?

    - by user622688
    Is ther any way to get data from other sites and display in our jsp pages dynamically. http://www.dictionary30.com/meaning/Misty see this url in that one block is like Wikipedia Meaning and Definition on 'Misty' In that block they are fetching the data from Wikipedia and displaying into dictionaly30. Question: How they are fetching wiki data to their site.? I need to display data like that in my jsp page by fetching from other site.

    Read the article

  • dynamic 404.jsp using struts

    - by Kapsh
    I would like to display an intelligent 404 page with some application data. Currently, there is a 'dumb' jsp, so I just forward to the view and I am done with it. But now I guess I really need to forward to an action so that I can set some more data to display on the error.jsp. How do I do it through configuration via struts-config? I need congifuration because I do not want to touch any individual files that might be forwarding to the existing view. I tried doing the fol, but I get an error and I dont see anything in the log. So currently, <forward name="ErrorView" path="/Error404.jsp" type="org.apache.struts.action.ActionForward"> </forward> What I want: <forward name="ErrorView" path="/errorAction.do" type="org.apache.struts.action.ActionForward"> </forward>

    Read the article

  • JSP cant find bean Class using "" modifiers

    - by Ravana
    Hey I'm using Netbeans for my IDE and I'm getting an error when I try to run my EJB program. I get an error when I declare and give the path of the class in my JSP to a bean. <jsp:useBean id="book" class="BookBean.Book" scope="application" /> <jsp:setProperty name="book" property="*" /> When I run the program I get this error javax.servlet.ServletException: java.lang.InstantiationException: class BookBean.Book : java.lang.IllegalAccessException: Class java.beans.Beans can not access a member of class BookBean.Book with modifiers "" and java.lang.InstantiationException: class BookBean.Book : java.lang.IllegalAccessException: Class java.beans.Beans can not access a member of class BookBean.Book with modifiers "" I removed the "" and put in '' to see if that works, but it doesn't. Any idea? I also put a breakpoint there and it def. is the root of the problem. Thanks.

    Read the article

  • Iterating over hashmap in JSP in struts application

    - by Rozer
    I have a HashMap object that I am getting on a JSP page. HashMap<Integer,Gift_product> gift_hm = new HashMap<Integer,Gift_product>(); gift_hm.put(17,new Gift_product("doll",67)); Now I need to iterate this and display content on JSP. The Gift_product class contains two fields: name and price. JSP output should be serial no. product name price 17 Doll 67 How can I achieve it?

    Read the article

  • How to read a parameter passed to a facelet from a backing bean

    - by Antonio
    Hi, I've written a facelet, and a corresponding backing bean, that implements user management (addition, deletion and so on). I'd want to be able to perform some custom processing when, for instance, a new user is added. There is a "create" button in the facelet, whose click event is handled by its backing bean. At the end of the event handler, I'd want to be able to call a method of another backing bean, which is not known because ideally the facelet can be used in several pages, with different custom processing. I thought to implement this feature by providing to the facelet a backing bean name and a method name, like this: <myfacelet:subaccounts backingBean="myBackingBean" createListener="createListener" /> and at the end of the event handler call #{myBackingBean.createListener} someway. I'm using this method (along with some overloads) to obtain a MethodExpression: protected MethodExpression getMethodExpression(String beanName, String methodName, Class<?> expectedReturnType, Class<?>[] expectedParamTypes) { ExpressionFactory expressionFactory; MethodExpression method; ELContext elContext; String el; el = String.format("#{%s['%s']}", beanName, methodName); expressionFactory = getApplication().getExpressionFactory(); elContext = getFacesContext().getELContext(); method = expressionFactory.createMethodExpression(elContext, el, expectedReturnType, expectedParamTypes); return method; } and the click event handler should look like: public void saveSubaccountListener(ActionEvent event) { MethodExpression method; ... method = getMethodExpression( "backingBean", "createSubaccountListener", SubuserBean.class); if (method != null) method.invoke( getFacesContext().getELContext(), new Object[] { _editedSubuser }); } That works fine as long as I provide an existing bean name (myBackingBean), but if I use backingBean the invoke() doesn't work due to the following error: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'backingBean' resolved to null Is there a way I can retrieve from the facelet backing bean the value of a parameter that has been passed to the facelet? In my case, the value of backingBean, which should be myBackingBean? I've searched for and tried different solutions, but with no luck yet.

    Read the article

  • can i use javabeans with hibernate ?

    - by Dilllllo
    Hello i'm using a plugin of hibernate2 in my webproject with jsp ,in my project i have a register page. Can i use javabeans to send information from a html <form> using hibernate class's ? with out hibernate i creat class with get and set like that package com.java2s; public class Lang { private String choix; private String comm; public String getChoix() { return choix; } public void setChoix(String choix) { this.choix = choix; //System.out.println(choix); } public String getComm() { return comm; } public void setComm(String comm) { this.comm = comm; // System.out.println(comm); } } but i know that hibernate generate a get and set class ! and recive it with that : <jsp:useBean id='user' class='com.java2s.Lang' type='com.java2s.Lang' scope='session' /> <jsp:setProperty name='user' property='*'/> any idea how to do that ?

    Read the article

  • I find a problem with sending receiving parameter

    - by kawtousse
    how to get the xml translation to html dropdownlist with ajax. I send the parameter with GET method but the JSP FILE THAT GENERATES THE XML DONT RECEIVE IT. var url="responsexml.jsp"; url=url+"?projectCode="+prj.options[prj.selectedIndex].value; xmlhttp.onreadystatechange=stateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); and then in responsexml.jsp I do like that: <% String projectcode= (String)request.getParameter("projectCode"); System.out.println("++++projectCode:=" +projectcode); Session s = null; Transaction tx; try { s = HibernateUtil.currentSession(); tx = s.beginTransaction(); Query query = s.createQuery("SELECT from Wa wa where wa.ProjectCode='"+projectcode+"'"); response.setContentType("text/xml"); PrintWriter output = response.getWriter(); output.write( "<?xml version=\"1.0\" encoding=\"utf-8\"?>"); //response.setHeader("Cache-Control", "no-cache"); //constriure le xml if(projectcode!=null) { for(Iterator it=query.iterate();it.hasNext();) { if(it.hasNext()) { Wa object=(Wa)it.next(); //out.print( "<item id=\"" +object.getIdWA() + "\" name=\"" + object.getWAName() + "\" />"); output.write("<wa>"); output.write( "<item id=\"" + object.getIdWA() + "\" name=\"" + object.getWAName() + "\" />"); output.write("</wa>"); } } } } catch (HibernateException e) { e.printStackTrace(); } %> </body> </html> With this code I dont have my xml file. I got this error: The server did not understand the request, or the request was invalid. Erreur de traitement de la ressource http://www.w3.o... PLEASE HELP.

    Read the article

  • Post method in Servlet is not being called again after being executed once

    - by SaurabhCsIITKgp
    I am implementing a database based web application using servlets. Now, when I input a parameter using a form in the jsp page, it redirects it to a servlet which subsequently adds the value to the database (the servlet creates a new table if the table doesn't already exist). The creation of the table and the addition of value works fine if the table doesn't already exists. Once it is created however and the parameter is inputted again in the form, the submit button no longer redirects it to the servlet. Nor is the value added to the database. Kindly advise me as to where I am going wrong. Following are the snippets of my code: From the JSP page (/showmanager is the urlpattern of the servlet): <form action="showmanager" method="post"> <h3>Enter name of the show: </h3> <input type="text" name="showname" value=""> <input type="hidden" name="task" value="addshow" /> <input type="button" value="Add Show"> </form> From the servlet (POST method): p rotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if(request.getParameter("task").equals("addshow")){ this.addShow(request.getParameter("showname")); response.sendRedirect("showmanager.jsp"); } } Method to add in database: protected boolean addShow(String showname){ try{ statement =con.prepareStatement("INSERT INTO showdb10(name) VALUES ('"+showname+"')"); if(statement.executeUpdate()>0){ return true; } } catch(Exception e) { try{ statement =con.prepareStatement("create table showdb10 (id int NOT NULL AUTO_INCREMENT, name varchar(255) NOT NULL, date varchar(20),time varchar(20), b_total int, o_total int, b_avbl int, o_avbl int, b_price double(10,2), o_price double(10,2), seat_no varchar(20), transaction_id varchar(255), total_sales double(10,2), paymnt_artists double(10,2), paymnt_othr double(10,2), flag varchar(20), PRIMARY KEY(id))"); statement.executeUpdate(); statement =con.prepareStatement("INSERT INTO showdb10(name) VALUES ('"+showname+"')"); if(statement.executeUpdate()>0){ return true; } }catch(Exception e2){} } return false; }

    Read the article

  • Images in Applet not showing in web page

    - by Leanne C
    I am trying to display a JPEG image and a moving dot on a Java applet which I am using on a web based application. However, when I run the applet it works fine, but when I display the applet from the JSP page, I get the moving dot but not the JPEG image. Is there a specific folder where the JPEG needs to be? These are the 2 methods i use for drawing the picture and the moving dot on the screen. public class mapplet extends Applet implements Runnable { int x_pos = 10; int y_pos = 100; int radius = 20; Image img, img2; Graphics gr; URL base; MediaTracker m; @Override public void init() { mt = new MediaTracker(this); try { //getDocumentbase gets the applet path. base = getCodeBase(); img = getImage(base, "picture.jpg"); m.addImage(img, 1); m.waitForAll(); } catch (InterruptedException ex) { Logger.getLogger(movement.class.getName()).log(Level.SEVERE, null, ex); } public void paint (Graphics g) { g.drawImage(img, 0, 0, this); // set color g.setColor (Color.red); // paint a filled colored circle g.fillOval (x_pos - radius, y_pos - radius, 2 * radius, 2 * radius); } The code one below is the call from the jsp page <applet archive="mapplet.jar" code="myapplets/mapplet.class" width=350 height=200> </applet> The jar file and the picture are in the same folder as the jsp page, and there is also a folder containing the contents of the class and image of the applet in the web section of the application. The applet loads fine however the picture doesn't display. I think it's not the code but the location of the picture that is causing a problem. Thanks

    Read the article

  • Alternative to using c:out to prevent XSS

    - by lynxforest
    I'm working on preventing cross site scripting (XSS) in a Java, Spring based, Web application. I have already implemented a servlet filter similar to this example http://greatwebguy.com/programming/java/simple-cross-site-scripting-xss-servlet-filter/ which sanitizes all the input into the application. As an extra security measure I would like to also sanitize all output of the application in all JSPs. I have done some research to see how this could be done and found two complementary options. One of them is the use of Spring's defaultHtmlEscape attribute. This was very easy to implement (a few lines in web.xml), and it works great when your output is going through one of spring's tags (ie: message, or form tags). The other option I have found is to not directly use EL expressions such as ${...} and instead use <c:out value="${...}" /> That second approach works perfectly, however due to the size of the application I am working on (200+ JSP files). It is a very cumbersome task to have to replace all inappropriate uses of EL expressions with the c:out tag. Also it would become a cumbersome task in the future to make sure all developers stick to this convention of using the c:out tag (not to mention, how much more unreadable the code would be). Is there alternative way to escape the output of EL expressions that would require fewer code modifications? Thank you in advance.

    Read the article

  • Servlet doPost() Method setup?

    - by Mark R
    I am interested in creating a web app that uses JSP, Servlets and XML. At the moment I have the following: JSP - Form input. Servlet - Retrieving Form data and sending that data to a java object. Java object (1) - Converts data into XML file....instantiates java object (2). Java object (2) - Sends that file to a database. On the returning side the database will send back another XML file that I will then process using XSLT to display back to the user. Can I place that XSLT code in the orignial Servlets doPost() method? So my doPost()` method would: Retrieve user inputted data from the form on my JSP page. Instantiate a java object to convert that data to XML, in-turn that object will instantiates another object to send the XML file to a database. Converts the resulting XML file sent from the database and displays it for the user. Can one servlet doPost() method handle all of this? If not, how would I set up my application and classes to handle this work flow? Thank you in advance

    Read the article

  • form:select items problem in spring mvc portlet

    - by dhaval
    I have a set of drop-down control which I want to render with my custom tag library. The following is the code of the tag lib: <spring:bind path="${path}"> <c:choose> <c:when test="${readOnly}"> <span class="readOnly">${status.value}</span> </c:when> <c:otherwise> <form:select path="${path }" itemLabel="${label }" itemValue="${value }" items="${itemList}"> </form:select> </c:otherwise> </c:choose> And this is the code I have written in the JSP file: <tag:conditionalListControl path="model.selectedCountry" readOnly="false" label="name" value="id" listItems="model.countryList" className="simple" /> Upon execution the paring returns the following error: [jsp:165] javax.servlet.jsp.JspException: Type [java.lang.String] is not valid for option items But if i change the items="${itemList}" to items="${model.countryList}" which is the list I want to display, it works fine without any problem and also bind to required variables on form submit. But i don't want to hard code any variables in the tag lib. Any suggestions???

    Read the article

  • jquery autocomplete extra spaces

    - by elasticrash
    I got this loop in a jsp file <% for (int i = 0; i < length; i++) { for( int j = 0; j < width; j++) { element = MAP_LIST[j][i]; if (element.equals("A")) {} else if (j == width-1 && i == length-1){ %> <%=element%><%} else { %> <%=element%>,<%} } } %> which gets me a csv list from an oracle database for my autocomplete text field by using jquery function Mapsheets(type,nomos) { $(function() { var f_data; $.get('/gaec_web/MapSheets.jsp',{'datasrc-select':datasource, 'type_1': type, 'nomos': nomos}, function(data){ f_data = data.split(','); $( "#fx_no" ).autocomplete({ source: f_data, minLength: 2 }); }); }); } everything works like a charm, i type the first 2 chars and the autocomplete pops up displays every thing as it was supposed to and when I try to pick a value i get the value with several (5) extra spaces in the tail. And then when it gets submitted it fails cause it doesnt match the mapname in question. the results look like this " 320-197" So what is causing this? if i run the jsp page alone also get normal results for example 372-146, 376-146, 372-149, 368-149, 376-149, 380-149, 380-152, 376-152, 372-152, 368-152, 368-155, 376-155, 372-155, 380-155, 368-158, 380-158, 376-158, 372-158 thanks in advance

    Read the article

  • best tomcat hosting servrice provider for jsp

    - by akshay
    I want to host my website build using jsp/java.I am looking for a good host which offer following features. unlimited bandwidth (to support large traffic.I dont want to run slowely) low price` good customer care suport that can help me in deploying in case of any problems I am running tight on budget.As i am a university passout. `

    Read the article

  • ui:include disables menu

    - by Goran B
    <rich:tab id="profileInfoTab" label="Information" labelWidth="80"> <ui:include src="/panels/tab2.jsp" /> </rich:tab> <rich:tab id="profileReferenceTab" label="Referenser" labelWidth="80"> <ui:include src="/panels/tab3.jsp" /> </rich:tab> If I include all code in /panel/tab1.jsp instead of the ui:include everything is OK. If I use the ui:include nothing is rendered. Not even the tab-panel. Why? Workarounds?

    Read the article

  • Data table multiple row selection

    - by Hari kanna
    i am a small time web develper i am working on JSF project i am a front end designer and also interested in JSF i try 2 solve this issue in web app... k my question is here... i have a datatable with checkbox i want 2 select multiple row selection with css background color....

    Read the article

< Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >