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
Similar Messages
-
XML Messaging and JSP. Is it possible?
Here is my situation.
We are developing JSP with a backend interface to external/remote Java/C++ applications. We like to implment, if possible, XML messaging between JSP and remote programs.
First of all, is this possible? Can JAXM be used in JSP?
Thanks in advance.Sure, but you might need to use polling for the JSP to get the response to show the user.
-
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.
YgI'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.
% -
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,
SenthilHello 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 onlyThis 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...
SaravananYou 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. -
File Sender channel polling successfully but not picking the files.
Hi All,
Can any one please provide any SAP Note Or any Alert mechanism for the File Sender channel in case where the XI channel in polling successfully at a particular folder from Source System but not picking the files. Thanks in Advance for the solution.Hello,
If you want to know the reason for failure in picking up the file ,You can check the MessagingSystem monitoring for the reason behind failure.
http://host:httpport/MessagingSystem/monitor/monitor.jsp
For Alert may be you can follow prateek instructions.
HTH
Rajesh -
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.
Maybe you are looking for
-
To clarify and to not receive the answers of those who doesn't read more than 2 lines of a post: I am not asking how can I delete backups to free space in iCloud nor how to hide the purchase history!!! those things I already know... to be clearer ple
-
Installing Oracle 10g on Windows 2008 SP2 64bits
Hello, I downloaded this version: 10204_vista_w2k8_x64_production_db. The setup starts fine, I set the location for the Oracle Home directory to (C: \oracle\product\10.2.0\db_1), click next, the setup continue and then stop with the following message
-
Photoshop Elements 11 Photo Editor won't open, trial info keeps popping up
Okay, I own Photoshop Elements 11 but the Photo Editor refuses to open. When I click it, a pop up shows up for the trial version of PSE 11 saying I should buy it. I already have the lisence for PSE11 so i don't know what the problem is. (Also Organiz
-
HT5622 how can we change apple id username...??
How can we change apple if username
-
Java.lang.IllegalAccessException while instaiating bean
Hi All, I am calling a bean from my JSP and the bean classes are in prpoper place i.e mywar/WEB-INF/classes/package structure in the use bean tag of JSP full class name is given. but weblogi