Polling in jsp

Dear All,
I'm an absolute newbe in .jsp programming, however I've to build a poll for a site for a rowing competition. Now recentley I saw an interesting poll at
http://www.club-vaio.sony-europe.com/clubvaio/en/home.jsp
now I did wonder if someone knows some interesting tutorials or peices of source code for such an application.
On forehand thanks for your support.
Yg

I'm not going to register to see that poll, but I can imagine what you'll need.
The basics are this:
(1) A database with a question and responses that you can analyze statistically,
(2) A JSP that presents the questions, binds up the responses, and forwards them to the database for safe keeping.
Depending on how skilled you are, you might want to add in security.
I'd recommend two things:
(1) Write your JSPs with JSTL. Hans Bergsten's O'Reilly book is a terrific source.
(2) Use Spring:
http://www.springframework.org.
It'll help you structure your web app very nicely. It's security model is very good.
%

Similar Messages

  • Jsp:useBean

    I really shouldn't be trying to use JSP any more ...
    I have been having problems using JavaBeans in JSP pages now - every time a problem is solved, that other little thing that always wanted a go at annoying me arrives ...
    The code is:
    <jsp:useBean id="pollResult" scope="application" class="com.ora.jsp.beans.poll.PollBean" />Because another JSP page I created (using JavaBeans) worked, using a JavaBean from the directory com.ora.jsp.beans.userinfo.UserInfoBean, I assumed that THIS would work - but it didn't! The error was:
    org.apache.jasper.JasperException: /calculate.jsp(11,2) According to TLD or attribute directive in tag file, attribute test does not accept any expressionsAnother problem, is there a solution?
    Sincerely, I'm sorry to plague everyone out there with all my problems - maybe I should give up and become a potato farmer instead ...

    Hi
    My Calculate.jsp looks like this:
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <jsp:useBean id="pollResult" scope="application"
      class="com.ora.jsp.beans.poll.PollBean" />
    <jsp:useBean id="answer" class="com.ora.jsp.beans.poll.AnswerBean" >
      <jsp:setProperty name="answer" property="*" />
    </jsp:useBean>
    <c:choose>
      <c:when test="${answer.valid}" >
        <c:set target="${pollResult}" property="answer"
          value="${answer}" />
        <jsp:forward page="result.jsp" />
      </c:when>
      <c:otherwise>
        <jsp:forward page="poll.jsp" />
      </c:otherwise>
    </c:choose>I am using JSTL 1.1.

  • Nicer method for inserting dynamic into a JSP

    I have a site layout which has header.jsp, menu.jsp, content.jsp(s), footer.jsp.
    Instead of having 10 various topic pages all of which including header,menu, and footer into them, I have opted for one JSP that loads the content.jsp based on a parameter in the URL e.g,
    index.jsp?content=news
    index.jsp?content=polls
    index.jsp?content=products
    So far I can do this by :
    <jsp:include page="includes/header.jsp" />
    <jsp:include page="includes/menu.jsp" />
    <%
    String content = request.getParameter("content");
    String action = request.getParameter("action");
    String id = request.getParameter("id");
    if(content.equals("news"))
    if(action == null)
    %>
    <jsp:include page="news/content.jsp" />
    <%
    else if(action != null)
    %>
    <jsp:include page="news/form.jsp" />
    <%
    if(content.equals("forums"))
    if(action == null)
    %>
    <jsp:include page="forums/content.jsp" />
    <%
    else if(action.equals("edit"))
    %>
    <jsp:include page="forums/showtopic.jsp" />
    <%
    // other IF blocks here
    %>
    <%@ include file="includes/footer.jsp" %>
    footer.jsp in constant so it is '<%@ include', the header and menu have content which can vary between views so they have '<jsp:include'.
    Originally I thought I could have one single
    <jsp:include page="<%=content%>/content.jsp" />
    or find any means to use the content variable to feed it into the JSP:INCLUDE, but it doesn't seem to be possible.
    Does anyone have any ideas for me?
    Many thanks

    Originally I thought I could have one single
    <jsp:include page="<%=content%>/content.jsp" />
    or find any means to use the content variable to fee
    it into the JSP:INCLUDE, but it doesn't seem to be
    possible.
    Does anyone have any ideas for me?
    Try:
    <% String pageName = content + "/content.jsp";   %>
    <jsp:include page="<%=pageName%>"/>or
    <jsp:include page='<%=content + "/content.jsp"%>' />

  • Nested jsp:include includes wrong file

    Hi,
    I've encountered a somewhat strange problem that's upsetting me for more than 3 hours by now. I've searched on the Web, Usenet, Tomcat Bugzilla, and the java.sun.com forums, but still didn't find a solution.
    Let me explain my current JSP/servlet flow:
    A servlet retrieves an article from a database, puts the article data into a bean, sets that bean as request attribute and includes a JSP to display the content of this bean (your basic MVC pattern). This works fine.
    The page being included by the "retrieve" servlet is actually a layout page (index.jsp) including the JSP (article.jsp) which displays the bean data, so the servlet actually includes "index.jsp?c=article.jsp" (with the bean as request attribute).
    In that index.jsp, there's a jsp:include that should include the output from another MVC-style servlet/JSP-block: Servlet "poll" creates a PollBean from a database, puts that as attribute into the request and includes "polls/show.jsp".
    Here's a simplified representation of my page layout:
    +---------+---+       The outer box is the "index.jsp", which
    |         |   |      
    |         |   |       a) includes the servlet "retrieve"
    |    1    | 2 |          which in turn includes "article.jsp"
    |         |   |          at position 1 and
    |         |   |
    |         |   |       b) includes the servlet "poll"
    |         |   |          which in turn _should_ include "polls/show.jsp"
    |         |   |          at position 2
    +---------+---+Well now, my problem is: Somehow Tomcat manages it to include the "article.jsp" TWICE at position 1 AND 2, although the jsp:include at positon 2 reads (that's hardcoded):
    <jsp:include page="/poll?action=latest&limit=1" />
    And in the PollServlet (as you guess, mapped to "/poll") the file to be included is hardcoded to "polls/show.jsp".
    If there wouldn't be anything included at position 2, that would pretty clearly be an error with wrong relative paths used in the jsp:include at position 2. But what really scares me is that the "article.jsp" get's included at position 2 although some debugging statements show that the PollBean is actually in the request after the jsp:include at position 2 has been executed.
    I just don't get it why "article.jsp" is included twice, and although the poll servlet is called, the "polls/show.jsp" doesn't show up anywhere.
    I've tried to flush the "out"-JSPWriter of "index.jsp" at several different key locations in the code, even flushed() in the PollServlet after including "polls/show.jsp" but that didn't help.
    If you need some proof of this weird behavior, ask in this thread and I'll post the link the website where that happens.
    Thanks in advance,
    phil

    Try deleting all the compiled JSPs (usually in a
    directory called "work") then requesting the pageThat's what I did, too. I've gone through the whole make-Tomcat-start-all-over procedure:
    - reloaded via webapp manager: nope
    - stopped/started via webapp manager: nope
    - clear /work/ directory and restarted Tomcat: nope
    Didn't help anything.
    Have you debugged your PollServlet to see if it's
    returning/including the right (hard-coded) page?Mmh.. What should I debug there? There's not much to debug, if stuff is hard-coded like ...
    I just found the error in my code! duh I was just looking in Eclipse for a piece of code to post here when I saw my mistake:
    The CMS I'm currently adding the poll feature to is more flexible than I thought (and that although I wrote it myself!):
    The article-retrieve servlet is called by this URL:
    /retrieve?nextPage=article.jsp&id=12345And my poll servlet is called by
    /poll?action=latest&limit=1Normally this would include the "polls/show.jsp" from the PollServlet because the code in PollServlet reads:
    // Use nextPage from request or show by default
    nextPage = request.getParameter("nextPage");
    if(nextPage == null) nextPage = "polls/show.jsp";But when the PollServlet got called from the "index.jsp?c=retrive&nextPage=article.jsp&id=123" page, there actually was a "nextPage" param and it's value was "article.jsp". And because there was still an ArticleBean in the request (from the ArticleRetrieveServlet), this "article.jsp" included by the PollServlet displayed the article a second time.
    I fixed it by including my PollServlet's output with the "nextPage" parameter explicitly set:
    /poll?action=latest&limit=1&nextPage=polls/show.jsp
    The other way to test is to change your hard-coded
    page to some arbitrary HTML page so you know that at
    least it IS being included.That's something I didn't think about :)
    The other thing to test is to request this page
    (action) directly. So type
    /poll?action=latest&limit=1 into the browser and see
    what you get.Already did that, no problems.
    Sorry I can't be of more help... but I would bet the
    farm that it's not a problem with Tomcat.You're right. I'd really be shocked to have me find 2 bugs in Tomcat within the last to weeks (although the bug was already fixed in a newer version of Tomcat)
    Also... You may want to consider using Struts for your
    MVC if you can.Lots of people keep telling me that, but I'll want to do a general cleanup of the code first - maybe then I'll convert to Struts. After all I'm a freelancer and currently don't have time to learn Struts.
    Thanks for your help,
    phil

  • Poll on my jsp

    I want to incorporate a poll on my jsp. Could anyone give me an idea how I could develop a poll for my page (and the best way to implement it)? By the way, I am just a newbie in jsp.
    I would appreciate anyone's help! Thanks.

    Hi
    I presume by poll you mean somthing like an opinion poll of 'n' unique users.
    There are a couple of ways of doing this.
    a. You could get the Remote Address/ Remote Host of the client from the ServletRequest. This way you could determine if the user had already accessed the poll, the draw back with this is that if the clients are behind a proxy then all of them will have the same hostname.
    b. You could use sessions to prevent multiple submits to a poll. i.e when the user accesses the page the user is assigned a session i.e a new session is created. The poll is accepted only when the session is created - the user is accessing the page for the first time. The drawback to this is that the same user can wait for a while until the session expires and then re-submit the poll.
    c. Here you would probably assign a login to any user who wants to answer the poll. This way you would do away with all the above mentioned problems as far as unique users are concerned but the only issue would be how many users would like to login just to answer a poll.
    Good Luck!
    Eshwar Rao
    Developer Technical Support
    Sun microsystems inc
    http://www.sun.com/developers/support

  • JSP-JavaBeans Vote Poll

    I made this thread a year back and I didn't get help that I wanted. I need to create a voting poll that has three choices for computer games that the user can choose from. each of these choices is a radio button. After making a choice, the user clicks vote, which should then show below:
    1)How many total votes have taken place
    2)Display the individual votes for each of the 3 choices and then show a percentage of total votes for each of the 3 choices. The following is an example of what this part should look like:
    Votes: 1 Computer Game 1 Percentage total: 100%
    If there were three votes, one for each of the game choices:
    Votes: 1 Computer Game 1 33%
    Votes: 1 Computer Game 2 33%
    Votes: 1 Computer Game 3 33%
    Total Votes: 3
    This is the format for the project. This is the JSP page I have created so far with no connection to a javabean:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <!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=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <table border="1" align="center">
    <tr>
    <td colspan="3" bgcolor="black" align="center"><font color="red" size="3">
    Computer Voting Poll-Erama</font></td></tr>
    <tr>
    <td colspan="3" bgcolor="black" align="center"><font color="red" size="3">
    What is your favorite computer game?
    </font></td></tr>
    <tr><td width="30%" bgcolor="black"></td>
    <td width="40%" bgcolor="black" align="center">
    <input type="radio" name="cgames" value="Oblivion" checked><font color="red" size="2"> Oblivion </font>
    <input type="radio" name="cgames" value="starwars"><font color="red" size="2"> Star Wars: Empire at War </font>
    <input type="radio" name="cgames" value="finalfantasy"><font color="red" size="2"> Final Fantasy XI: Online </font>
    <input type="submit" value="votebutton" name="Vote">
    </td>
    <td bgcolor="black" width="30%"></td>
    </tr>
    <tr><td bgcolor="black" colspan="3" align="center"><font color="red" size="3">
    </font><font color="white" size="3">Total Votes</font></td></tr>
    <tr><td height="15" bgcolor="red" colspan="3"></td></tr>
    <tr><td align="left" bgcolor="black"><font color="white" size="3">0</font></td>
    <td align="left" bgcolor="black"><font color="white" size="3">Oblivion</font></td>
    <td align="center" bgcolor="black"><font color="white" size="3">0.00%</font></td>
    </tr>
    <tr><td align="left" bgcolor="black"><font color="white" size="3">0</font></td>
    <td align="left" bgcolor="black"><font color="white" size="3">Star Wars: Empire at War</font></td>
    <td align="center" bgcolor="black"><font color="white" size="3">0.00%</font></td>
    </tr>
    <tr><td align="left" bgcolor="black"><font color="white" size="3">0</font></td>
    <td align="left" bgcolor="black"><font color="white" size="3">Final Fantasy XI: Online</font></td>
    <td align="center" bgcolor="black"><font color="white" size="3">0.00%</font></td>
    </tr>
    <tr><td height="15" bgcolor="red" colspan="3"></td></tr>
    </table>
    </body>
    </html>
    I have little experience with beans and very little java experience so I'm at a loss for understanding how to make this work. Any examples of code would be very helpful. Thanks.

    Come now, you really don't expect us to believe that you've been working at this for a year with no headway? :)
    Anyway, have you been through the trails that I linked to in your other thread? For JSPs and Servlets? Have a read at the JavaBeans trail [1] while you're at it.
    And if you've got a specific question about some part where you're getting stuck, please post that. Because as of now, it looks like you need help with the whole thing. Please understand that while no one refuses to help you, people will usually not hand out ready made code for you to use. You need to show that you understand what you're doing and have put in effort with your work and are genuinely stuck despite trying.
    Which part are you unable to do? Reading the selected choice? Adding the data to a bean? Displaying the second page?
    [1] http://java.sun.com/docs/books/tutorial/javabeans/
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://www.catb.org/~esr/faqs/smart-questions.html
    ----------------------------------------------------------------

  • Simple poll/comment box in JSP

    Howdy, I'm trying to create a simple poll containing five options, as well as a comment box (consisting of a text box and a submit button), both of which show results on the same page they're on. I've been searching for some examples, but have had no luck. Can anyone point me in the right direction or help me out with any sites that have example source code dealing with this sort of thing? Thanks!

    Here is a simple example:
    <html>
    <head>
    <title>My Page</title>
    </head>
    <body>
    <form method="GET" action="/servlet1">
    <div align="center"><br>
    <input type="radio" name="group1" value="Milk"> Milk<br>
    <input type="radio" name="group1" value="Butter" checked> Butter<br>
    <input type="radio" name="group1" value="Cheese"> Cheese
    <hr>
    <textarea name="comments" cols="40" rows="5">
    Enter your comments here...
    </textarea><br>
    <input type="submit" value="Submit" />
    </div>
    </form>
    </body>
    </html>

  • How do I use the XML-data from a callback in JSP?

    I´ve tried this but with no success..
    How do I recieve the data in a servlet/JSP-page?
    Thanks.

    Thanks for helping me Anurag.
    The problem I tried to solve was that I want the result from my service methods
    in XML format. I thought a callback/polling was the best alternative, am I right?
    Since the callback option doesn´t work I will try to poll the service.
    Are there any other options for solving my problem??
    Thanks again!!
    /A
    "Anurag Pareek" <[email protected]> wrote:
    >
    Andrej,
    I guess you are trying to invoke a Webservice which defines a callback
    method
    from a JSP, and want the JSP to handle the callback made by the webservice.
    For a client to be able to handle a callback made by a Webservice, it
    has to be
    a web service in itself.
    Even some web service tools do not support 'Solicit responses' and hence
    they
    would not generate handlers for the callback methods by default. You
    can download
    a callback WSDL in such cases and implement it on the client side. The
    server
    side web service will then callback to that webservice.
    The other option to callbacks is to use polling methods. This can be
    done from
    any client such as Java client/ JSP client or a .NET client.
    Hope this helps. Let me know if you have any further questions.
    Regards,
    Anurag
    "Andrej" <[email protected]> wrote:
    I´ve tried this but with no success..
    How do I recieve the data in a servlet/JSP-page?
    Thanks.

  • How do I use dynamic JSP vars in a form tag with implicit sessions?

    I'm using iAS 6 SP4 and 'lite' sessions w/ sticky LB on Win2K for development and need to use a dynamic variable (via an = scriptlet) to specify the URL a form tag's ACTION method posts to. The implicit URL session encoding attempts to add the hidden input tags to the form but part of it is getting cut off. If I remove the dynamic var scriptlet from the form tag it works fine. How can I use dynamic vars and implicit URL session encoding?
    Here's my code sample:
    <FORM NAME='Create' METHOD='POST' ACTION='<%= servletRootStr %>CreateServlet' TARGET='_top'>
    Output is:
    <FORM NAME='Create' METHOD='POST' ACTION='http://my.server.com/NASApp/WebStuffApp/Create' TARGET='_top'>T NAME="GXHC_gx_session_id_" TYPE="HIDDEN" VALUE="GXLiteSessionID--8351372849698357580" ></INPUT><INPUT NAME="GXHC_GX_jst" TYPE="HIDDEN" VALUE="d692bc3d662d6164" ></INPUT>
    Because the <INPUT> tagon the first session var is cut off, up to the T, the page obviously fails. Can this be fixed with a config setting, or is it a bug in iPlanet??

    Thanks for helping me Anurag.
    The problem I tried to solve was that I want the result from my service methods
    in XML format. I thought a callback/polling was the best alternative, am I right?
    Since the callback option doesn´t work I will try to poll the service.
    Are there any other options for solving my problem??
    Thanks again!!
    /A
    "Anurag Pareek" <[email protected]> wrote:
    >
    Andrej,
    I guess you are trying to invoke a Webservice which defines a callback
    method
    from a JSP, and want the JSP to handle the callback made by the webservice.
    For a client to be able to handle a callback made by a Webservice, it
    has to be
    a web service in itself.
    Even some web service tools do not support 'Solicit responses' and hence
    they
    would not generate handlers for the callback methods by default. You
    can download
    a callback WSDL in such cases and implement it on the client side. The
    server
    side web service will then callback to that webservice.
    The other option to callbacks is to use polling methods. This can be
    done from
    any client such as Java client/ JSP client or a .NET client.
    Hope this helps. Let me know if you have any further questions.
    Regards,
    Anurag
    "Andrej" <[email protected]> wrote:
    I´ve tried this but with no success..
    How do I recieve the data in a servlet/JSP-page?
    Thanks.

  • Problem with af:poll in IE

    In my searchpage, i've <af:poll> which will show the timer once the user selects some rows from resultstable and clicks "submit". The timer will run till some processing is done . Intermittently, i face the foll issue in IE but not in Mozilla.Sometimes,the results table doesn't refresh and show the last executed search result. instead it shows the empty results table and i see a error icon in the bottom left portion of browser's status bar. This issue happens only in IE and that too only if i have af:poll. i'm pasting the code for searchpage jsp . Please
    help me out if you get any clue.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
    <f:view>
    <afh:html>
    <afh:head title="Search and Add Entities">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <f:verbatim>
    <script type="text/javascript" >
    function deactivatePoll()
    if(self._pollManager)
    _pollManager.deactivateAll();
    </script>
    </f:verbatim>
    </afh:head>
    <afh:body inlineStyle="margin:0.0pt; padding:0.0pt;" onload="deactivatePoll();">
    <f:verbatim>
    <script type="text/javascript" >
    function reactivateProgressIndicators()
    if (self._pollManager)
    document.getElementById('panelHeader').style.display='';
    document.getElementById('searchRegion').style.display='none';
    document.getElementById('resultsRegion').style.display='none';
    _pollManager.reactivateAll();
    </script>
    </f:verbatim>
    <af:messages/>
    <af:form id="searchForm">
    <af:panelHeader id="panelHeader" inlineStyle="display:none">
    <af:objectSpacer height="50" />
    <af:progressIndicator id="progressIndicator"
    value="#{ProgressIndicatorBean}"
    partialTriggers="pollid" >
    <af:outputFormatted styleUsage="instruction"
    value="Adding Entities..."
    rendered="#{ProgressIndicatorBean.value == -1}"/>
    <af:outputFormatted styleUsage="instruction"
    value="#{ProgressIndicatorBean.value} of #{ProgressIndicatorBean.maximum} Completed"
    rendered="#{ProgressIndicatorBean.value > -1}"/>
    </af:progressIndicator>
    <af:poll id="pollid" interval="1000" />
    </af:panelHeader>
    <af:panelHeader text="Search and Select Entity" id="searchRegion"
    inlineStyle="background-color:#ebf0f5;margin:10.0pt;" >
    <af:panelBorder>
    <af:objectSpacer width="10" height="10"/>
    <f:facet name="end">
    <af:panelButtonBar>
    <af:commandButton text="Cancel" action="#{dialogbean.cancelDialog}"
    styleClass="AFbuttonEnabled" />
    <af:commandButton text="Submit" actionListener="#{dialogbean.submitDialog}" onclick="reactivateProgressIndicators();"
    styleClass="AFbuttonEnabled" id="submitBtn" />
    </af:panelButtonBar>
    </f:facet>
    </af:panelBorder>
    <af:objectSpacer width="10" height="10"/>
    <af:panelForm width="50%">
    <af:selectOneChoice value="#{dialogbean.application}"
    label="Product">
    <f:selectItems value="#{dialogbean.applicationsMap}"/>
    </af:selectOneChoice>
    <af:inputText value="#{dialogbean.entity}"
    label="Entity Name" id="entityName"
    binding="#{dialogbean.entityName}"
    >
    </af:inputText>
    <af:inputText value="#{dialogbean.description}"
    label="Description"
    >
    </af:inputText>
    <f:facet name="footer">
    <af:panelGroup layout="vertical">
    <af:panelButtonBar>
    <af:commandButton actionListener="#{dialogbean.doSearch}"
    text="Search" id="Search"
    styleClass="AFbuttonEnabled"
    >
    </af:commandButton>
    </af:panelButtonBar>
    </af:panelGroup>
    </f:facet>
    </af:panelForm>
    </af:panelHeader>
    <af:objectSpacer width="10" height="20"/>
    <af:panelHeader text="Results" id="resultsRegion"
    inlineStyle="background-color:#ebf0f5;margin:10.0pt;">
    <af:table value="#{dialogbean.tableModel}" var="row"
    width="80%" rows="10" banding="row" bandingInterval="1"
    emptyText="No items were found"
    binding="#{dialogbean.searchResultsTable}" id="resultsTable"
    selectionListener="#{dialogbean.selectionListener}"
    sortListener="#{dialogbean.sortListener}" >
    <f:facet name="selection">
    <af:tableSelectMany text="Select" autoSubmit="true" id="radio" />
    </f:facet>
    <af:column sortProperty="entityName" sortable="true"
    headerText="Entity name">
    <af:outputText value="#{row.entityName}"/>
    </af:column>
    <af:column sortProperty="entityDesc"
    headerText="Description">
    <af:outputText value="#{row.entityDesc}"/>
    </af:column>
    <af:column sortProperty="appName" sortable="true"
    headerText="Product">
    <af:outputText value="#{row.appName}"/>
    </af:column>
    <af:column sortProperty="entityType" sortable="true"
    headerText="Type">
    <af:outputText value="#{row.entityType}"/>
    </af:column>
    <af:column headerText="Related entities" formatType="icon">
    <af:commandLink rendered="#{row.selected}"
    action="#{dialogbean.showRelatedEntities}">
    <af:objectImage
    source="/images/viewrelatedassets_enabled.gif" align="middle"
    rendered="#{row.selected}"/>
    </af:commandLink>
    <af:objectImage
    source="/images/viewrelatedassets_disabled.gif" align="middle"
    rendered="#{not row.selected}"/>
    </af:column>
    </af:table>
    </af:panelHeader>
    </af:form>
    </afh:body>
    </afh:html>
    </f:view>
    Thanks,
    Senthil

    Hello Daniel,
    This is the Adobe Dreamweaver Developer's Toolbox forum, I think you are looking for the Spry forums.
    http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid=72&catid=602
    Shane

  • How can i redirect to another JSP page automatically after some event

    I am developing a Tic-Tac-Toe game which can be played between two players who are on two different machines.
    When the first player comes to the Welcome page he will redirected to a Waiting Page when he clicks on the 'Start' button.
    When the second player comes to the Welcome page he will be redirected directly to the Game page, on clicking the 'Start' button.
    So how can i redirect the first player to the Game page after the second player is available for the game.
    And if i want to manage multiple instances of my game how can i do that//
    I am using JSP, javascript and MySQL for developing my project, and I am new to all these tools, but i would still like to carry on with all these only

    This is a bit of a challenge because of the nature of the web. Generally the web is "pull only" meaning that the browser has to initiate any interactions - the server can't push data to the browser if it wasn't asked to.
    The easiest way to solve this is using AJAX via JavaScript to periodically poll the server for any status changes. There are other ways (the Comet protocol is one) but they start to get a bit difficult and are still a bit new and not completely supported in a standards way. And to be honest they are still basically polling though in a more efficient way.
    Are you using a JavaScript framework? Most of the JavaScript frameworks that I've used have built in support for polling in the background. You'd have to have the JSP/servlet side be able to handle these polling requests from the browser and, when another person joins the game, the server indicates that and sends that back to the browser.
    As far as multiple instances I would have the server automatically pair up users as needed. So when the first player arrives he has to wait for another player. When the second player arrives a new game is created for those two players. Now a third player arrives and waits until a fourth player shows up. When player 4 joins another separate game is created. Presumably the conversation between the browser and the server will need to include a "game number" or other unique number so that the server can keep track of the games.

  • Can we ask more than one question at a time in Quick Poll?

    Dear Experts,
    Can we have more than one question at a time in Quick Polling.
    The User has to answer more than one question in single poll.
    is that possible?
    Thanks in advance for your attention.
    Regards,
    Viswes.

    Hi Viswes,
    Through customize u can achieve ur requirement..
    Create two Quickpoll with different campaign name and start ongoing..
    Next create  iview for each quickpoll by using KM QuickPoll iView Template  enter the corresponding campaign name for the quickpoll iview.
    Next create one JspDynPage component in NWDS
    In that JSP file
    <iframe  src="Give the preview path of Quickpoll iView 1" align="left" >
    </iframe>
    <iframe  src="Give the preview path of Quickpoll iView2 " align="left" >
    </iframe>
    Now u create one iview for that JspDynPage component
    in that two Quickpoll question will display in one iView..
    Points are welcome if its helpful
    Regards
    Thillai

  • How to poll a java class in blazeDS

    Hi,
         i want to poll a java class.in fds-tomcat sample applications they developed feed application.there we are starting the startfeed.jsp file.to push data to  all the clients,here the thread is running in loop.but i want a java class that it should be polled by the server by configuring polling-interval.

    include it as a library
    open project settings goto libraries and simply add your class

  • Trying to call a data bean from jsp

              I get the following error:
              C:\bea\user_projects\infologic1\.\myserver\.wlnotdelete\extract\myserver_BibleApp_BibleApp\jsp_servlet\__menu.java:146:
              cannot resolve symbol
              probably occurred due to an error in /menu.jsp line 27:
              Enumeration.categoryIds = categories.keys();
              code:
              menu.jsp
              <%@page import="java.util.*"%>
              <jsp:useBean id="DbBean" scope="application" class="showMeItNow.DbBean"/>
              <%
              String base = (String) application.getAttribute("base");
              %>
              <table width="150" cellpadding="5" height="75" cellspacing="0" border="0">
              <tr>
              <td>
              <form>
              <input type="hidden" name="action" value="search">
              <input type="text" name="keyword" size="10">
              <input type="submit" value="go">
              </form>
              </td>
              </tr>
              <tr>
              <td>category</td>
              </tr>
              <tr>
              <tr valign="top">
              <%
              Hashtable categories = DbBean.getCategories();
              Enumeration.categoryIds = categories.keys();
              while (categoryIds.hasMoreElements()) {
              Object categoryId = categoryIds.nextElement();
              out.println("<a href=" + base + "? action=browseCatalog&categoryId="
              + categoryId.toString() + ">" + categories.get(categoryId) + "</a><br>");
              %>
              web.xml
              <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
              "http://java.sun.com/dtd/web-app_2_3.dtd">
              <web-app>
                   <servlet>
                        <servlet-name>ControllerServlet</servlet-name>
                        <servlet-class>ControllerServlet</servlet-class>
              <init-param>
                   <param-name>base</param-name>
                   <param-value>http://localhost:7001/BibleApp/</param-value>
              </init-param>
              <init-param>
                   <param-name>imageURL</param-name>
                   <param-value>http://localhost:7001/BibleApp/</param-value>
              </init-param>
              <init-param>
                   <param-name>dbURL</param-name>
                   <param-value>jdbc:weblogic:mssqlserver4:users@COMPAQSERVER</param-value>
              </init-param>
              <init-param>
                   <param-name>usernameDbConn</param-name>
                   <param-value>dinesh</param-value>
              </init-param>
              <init-param>
                   <param-name>passwordDbConn</param-name>
                   <param-value>passs</param-value>
              </init-param>
              </servlet>
              </web-app>
              DbBean.class
              package showMeItNow;
              import java.util.*;
              import java.sql.*;
              import showMeItNow.Poll;
              public class DbBean {
              public String dbUrl="";
              public String dbUserName="";
              public String dbPassword="";
              public void setDbUrl(String url) {
              dbUrl=url;
              public void setDbUserName(String userName) {
              dbUserName=userName;
              public void setDbPassword(String password) {
              dbPassword=password;
              public Hashtable getCategories() {
              Hashtable categories = new Hashtable();
              try
              Connection connection = DriverManager.getConnection(dbUrl, dbUserName,
              dbPassword);
              CallableStatement cstmt = connection.prepareCall("{? = call dbo.categoryListing()}");
              //register the stored procedure's output paramater!!!
              cstmt.registerOutParameter(1, java.sql.Types.VARCHAR);
              cstmt.registerOutParameter(2, java.sql.Types.VARCHAR);
              ResultSet rs = cstmt.executeQuery();
              while (rs.next()) {
              categories.put(rs.getString(1), rs.getString(2) );
              rs.close();
              cstmt.close();
              connection.close();
              catch (SQLException e) {  }
              return categories;
              

    You might want to look at whether there is any data being fetched from
              the DB. Use some System.out.println()'s in the code where you fetch the
              data from the stored proc.
              Another way might be to comment out the database code, add some dummy
              values into the hastable and make sure that the page comes up as you
              expect.. and then go ahead with the database thingy..
              Nagesh
              dinesh wrote:
              > Thanks, the page is loading up. But, it is just blank. It is not displaying the
              > hastable data. Any ideas?
              >
              > thanks again,
              > Dinesh
              >
              > Nagesh Susarla <[email protected]> wrote:
              >
              >>>Enumeration.categoryIds = categories.keys();
              >>
              >>try replacing the dot '.' with a space and it should be all fine ..
              >>maybe a typo.
              >>
              >>Enumeration categoryIds = categories.keys();
              >>
              >>--
              >>Nagesh
              >>
              >>
              >>dinesh prasad wrote:
              >>
              >>>I get the following error:
              >>>
              >>>C:\bea\user_projects\infologic1\.\myserver\.wlnotdelete\extract\myserver_BibleApp_BibleApp\jsp_servlet\__menu.java:146:
              >>>cannot resolve symbol
              >>>probably occurred due to an error in /menu.jsp line 27:
              >>>Enumeration.categoryIds = categories.keys();
              >>>
              >>>
              >>>code:
              >>>
              >>>menu.jsp
              >>>----------
              >>><%@page import="java.util.*"%>
              >>><jsp:useBean id="DbBean" scope="application" class="showMeItNow.DbBean"/>
              >>>
              >>><%
              >>> String base = (String) application.getAttribute("base");
              >>> %>
              >>>
              >>>
              >>><table width="150" cellpadding="5" height="75" cellspacing="0" border="0">
              >>><tr>
              >>><td>
              >>><form>
              >>><input type="hidden" name="action" value="search">
              >>><input type="text" name="keyword" size="10">
              >>><input type="submit" value="go">
              >>></form>
              >>></td>
              >>></tr>
              >>><tr>
              >>><td>category</td>
              >>></tr>
              >>><tr>
              >>><tr valign="top">
              >>>
              >>> <%
              >>> Hashtable categories = DbBean.getCategories();
              >>> Enumeration.categoryIds = categories.keys();
              >>> while (categoryIds.hasMoreElements()) {
              >>> Object categoryId = categoryIds.nextElement();
              >>> out.println("<a href=" + base + "? action=browseCatalog&categoryId="
              >>>+ categoryId.toString() + ">" + categories.get(categoryId) + "</a><br>");
              >>>}
              >>>
              >>> %>
              >>>-------------------------------------------------------------------------------------
              >>>
              >>>web.xml
              >>><!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
              >>
              >>2.3//EN"
              >>
              >>>"http://java.sun.com/dtd/web-app_2_3.dtd">
              >>>
              >>><web-app>
              >>>     <servlet>
              >>>          <servlet-name>ControllerServlet</servlet-name>
              >>>          <servlet-class>ControllerServlet</servlet-class>
              >>>     
              >>><init-param>
              >>>     <param-name>base</param-name>
              >>>     <param-value>http://localhost:7001/BibleApp/</param-value>
              >>></init-param>
              >>>
              >>><init-param>
              >>>     <param-name>imageURL</param-name>
              >>>     <param-value>http://localhost:7001/BibleApp/</param-value>
              >>></init-param>
              >>><init-param>
              >>>     <param-name>dbURL</param-name>
              >>>     <param-value>jdbc:weblogic:mssqlserver4:users@COMPAQSERVER</param-value>
              >>
              >>></init-param>
              >>><init-param>
              >>>     <param-name>usernameDbConn</param-name>
              >>>     <param-value>dinesh</param-value>
              >>></init-param>
              >>><init-param>
              >>>     <param-name>passwordDbConn</param-name>
              >>>     <param-value>passs</param-value>
              >>></init-param>
              >>> </servlet>
              >>></web-app>
              >>>     
              >>>          
              >>>-----------------------------------------------------------------------
              >>>DbBean.class
              >>>
              >>>package showMeItNow;
              >>>
              >>>import java.util.*;
              >>>import java.sql.*;
              >>>import showMeItNow.Poll;
              >>>
              >>>public class DbBean {
              >>> public String dbUrl="";
              >>> public String dbUserName="";
              >>> public String dbPassword="";
              >>>
              >>> public void setDbUrl(String url) {
              >>> dbUrl=url;
              >>> }
              >>>
              >>> public void setDbUserName(String userName) {
              >>> dbUserName=userName;
              >>> }
              >>>
              >>> public void setDbPassword(String password) {
              >>> dbPassword=password;
              >>> }
              >>>
              >>> public Hashtable getCategories() {
              >>> Hashtable categories = new Hashtable();
              >>> try
              >>> {
              >>> Connection connection = DriverManager.getConnection(dbUrl,
              >>
              >>dbUserName,
              >>
              >>>dbPassword);
              >>>
              >>> CallableStatement cstmt = connection.prepareCall("{?
              >>
              >>= call dbo.categoryListing()}");
              >>
              >>> //register the stored procedure's output paramater!!!
              >>> cstmt.registerOutParameter(1, java.sql.Types.VARCHAR);
              >>> cstmt.registerOutParameter(2, java.sql.Types.VARCHAR);
              >>> ResultSet rs = cstmt.executeQuery();
              >>> while (rs.next()) {
              >>> categories.put(rs.getString(1), rs.getString(2) );
              >>> }
              >>> rs.close();
              >>> cstmt.close();
              >>> connection.close();
              >>> }
              >>> catch (SQLException e) {  }
              >>> return categories;
              >>> }
              >>>
              >>>}
              >>>
              >>>
              >>>
              >>
              >
              

  • How to Upload a File in Bpel Process using JSP

    I am trying to upload file in bpel process using front end as a Jsp.
    i create the jsp page and i am able to pass the value from jsp to bpel process.
    In bpel process i don't know how to pass or assign the specified file name into file adapter for reading the files.
    Please help me...
    Saravanan

    You don't assign the url of the file to it.
    To either get the data from the file into the bpel process you could use the url-parameter together with the ora:readFile function....or you could let your web-application upload the file to some location on the server...and on this location you could use the file-adapter together with the polling, to start your bpel process.

Maybe you are looking for