How to read parameters from request object
We want to read parameters from GET request
but whenever we are calling GET_URI_PARAMETER from the REQUEST we don't see any results
url is like
http://coevi116.wdf.sap.corp:8000/sap(bD1lbiZjPTEwMA==)/bc/bsp/sap/z_test_json/jsontest.htm?PARAM=ABC
But reading PARAM is not givng value of ABC
onCreate and onRequest wherever we put the code it is not reading the value
Can anyone please help and share some expert opinion
in jsontest.htm page create a page attribute named "PARAM" with auto check box checked and check in oninitialization, this will carry the value passed to param from url.
Similar Messages
-
How to access parameters from an object stored in a shopping-cart vector?
Hello;
I am writing some code that will be part of a website that will have the
ability to allow customers to place items into a shopping cart and then
purchase them.
The way that the shopping cart works is that a products page is displayed on the website that has 'add' buttons on it next to each product on the page.
When the customer clicks the 'add' button next to a particular product to purchase it, the code performs a query of a products database table for the numeric product id linked to the 'add' button they clicked.
When the product id is found, the query then loads the
product information for it from the DB table columns into the shopping cart
Vector as an object in the form of a result set string. This object contains
the parameters that define the product, i.e. product_id, product_quantity,
date_ordered, ship_status and so on.
In the code, when the customer is done shopping and clicks on a button
labelled 'place order', I want the code to access the shopping cart Vector
and extract each item object from the cart. I then want the code to be able
to get from each item object, the parameters that make up each item as
described above and take the values stored in each of the parameters and
store them in variables. Finally I want to take those variables and write
them to an orders DB table in the proper columns via a query.
I have tried researching information on Vectors to see if I could find out a way to do this but the little information that I located did not give me a clear idea
of how to go about writing the code, it only seemed to suggest a vague,
rough idea as to how it might be done. I am relatively new to Java
programming and so don't have any experience working with Vectors.
I have enclosed the code below that shows how the items are being stored in the shopping cart Vector. Can anybody tell me how I could go about writing the code that will extract the items from the shopping cart as described above in a servlet? Any assistance you can give me will be greatly appreciated.
Thank you!
String productID = request.getParameter("productID");
String qty = request.getParameter("qty");
Vector cartlist = new Vector();
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
java.sql.Connection conn = java.sql.DriverManager.getConnection("jdbc:odbc:website", "", "");
java.sql.Statement st = conn.createStatement();
String query = "SELECT productID, productName, productCategory,
productPrice from Products WHERE productID ='" + productID + "'";
java.sql.ResultSet rs = st.executeQuery(query);
while(rs.next()){
cartlist.addElement(rs.getString("productID") + " " +
rs.getString("productName") + " " +
rs.getString("productCategory") + " " +
rs.getString("productPrice") + " " + qty);
} catch(SQLException sqlex){
} catch(Exception e){
}//Try Changing your code this way.
String productID = request.getParameter("productID");
String qty = request.getParameter("qty");
Vector cartlist = new Vector();
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
java.sql.Connection conn = java.sql.DriverManager.getConnection("jdbc:odbc:website", "", "");
java.sql.Statement st = conn.createStatement();
String query = "SELECT productID, productName, productCategory, productPrice from Products WHERE productID ='" + productID + "'";
java.sql.ResultSet rs = st.executeQuery(query);
while(rs.next())
String productID = rs.getString("productID");
String productName = rs.getString("productName");
String productCategory = rs.getString("productCategory");
String productPrice = rs.getString("productPrice");
String productID = rs.getString("productID");
cartlist.addElement(new AddCardElement(productID, productName, productCategory, productPrice, productID, qty));
//class AddCardElement should be there in your application
catch(SQLException sqlex)
catch(Exception e)
//you have to add a new class AddCardElement like this
class AddCardElement
public String m_productID;
public String m_productName;
public String m_productCategory;
public String m_productPrice;
public String m_productID;
public GenerateLocationData(String productID, String productName, String productCategory, String productPrice, String productID, String qty)
m_productID = productID;
m_productName = productName;
m_productCategory = productCategory;
m_productPrice = productPrice;
m_productID = productID;
}//-Achyuth B -
[Urgent] How to read files from different directories?
I am new to Java Programming, I would like to know how to read files from directories other than the current one? (example as follows)
ProjectDirectory
|--MainDirectory
|--MainProgram.java
|--SupplementDirectory
|--SupplementProgram.java
|--Pictures
|--Image.gif
What should I write in the MainProgram.java so that I can use the supplementProgram.java from MainProgram and read the Image.gif file from the MainProgram.java?
ThanksRun through the I/O tutorial here. It should get you up to speed on this sort of thing...
-
How to read data from a CLUSTER STRUCTURE not cluster table.
Hi,
how to read data from a CLUSTER STRUCTURE not cluster table.
regards,
Usha.Hello,
A structre doesnt contain data.. so u cannot read from it. U need to find out table of that structure and read data from it.
Regards,
Mansi. -
How to read data from a file that was formatted by excel?
Hi everyone, I'm familiar with java.io and the ability to read from files, can anyone tell me how to read data from a file that was formatted by excel? Or at least give me some web references so that I can learn about it?
http://jakarta.apache.org/poi/hssf/index.html
HSSF stands for Horrible Spreadsheet Format, but it still works! -
How to read data from a router by using labview
I am a beginner labview. How to read data from a router by using labview ?
What kind of data are you trying to read?
Does the router behave like a webserver that you log into? If so, search the forums for threads discussing HTML. -
How to read data from a connected modem
any one can help me? how to read data from a connected modem. The modem received real-time data from other server. The data is in text format. I can see this text when I used hyperterminal for dial up and the data is accumulated such as:
@aa1235678
@bb2135647
@cc5214367
since it is real-time data, I want to read one line each time instantly when it arrives.You need to use the Java Communications API. (http://java.sun.com/products/javacomm/index.html)
-
How to read data from a zipped MS Access file?
How to read data from a zipped MS Access file?
RPJ,
You do not need to use the Close Zip File.vi when you unzip a folder. This VI is used when you are creating a zip folder.
As for examples, I found a couple of ActiveX based MS Access examples. These programs look to be pretty basic. For more in depth example I would search Microsoft Developers Network
http://zone.ni.com/devzone/cda/epd/p/id/2188
http://zone.ni.com/devzone/cda/epd/p/id/1694
Regards,
Jon S.
National Instruments
LabVIEW R&D -
How to read data from an internal table into a real table?
Hello experts,
I'm relatively new to ABAP and I'm trying to figure out how to read data from an internal table into a table that I created. I'm trying to use the RRW3_GET_QUERY_VIEW_DATA function module to read data from a multiprovider. I'm trying to read data from the e_cell_data and e_axis_data tables into a table that I've already created. Please see code below.
TABLES MULTITAB.
DATA:
query_name TYPE RSZCOMPID,
s_cubename TYPE RSINFOPROV,
t_cell_data TYPE RRWS_T_CELL,
t_axis_data TYPE RRWS_THX_AXIS_DATA,
t_axis_info TYPE RRWS_THX_AXIS_INFO,
wa_t_cell_data like line of t_cell_data,
wa_t_axis_data like line of t_axis_data,
w_corp_tab like line of t_cell_data.
s_cubename = 'CORP_MPO1'.
query_name = 'Z_corp_test'.
CALL FUNCTION 'RRW3_GET_QUERY_VIEW_DATA'
EXPORTING
i_infoprovider = s_cubename
i_query = query_name
i_t_parameter = query_string_tab
IMPORTING
e_cell_data = t_cell_data
e_axis_data = t_axis_data
e_axis_info = t_axis_info.
If anyone has any information to help me, I would greatly appreciate it. Thanks.Hi,
<li>Once you call the function module RRW3_GET_QUERY_VIEW_DATA, lets say data is available in the corresponding tables e_cell_data e_axis_data which you have mentioned.
<li>Modify your internal table defined for other purpose, with data from e_cell_data e_axis_data like below.
LOOP AT t_cell_data INTO wa_t_cell_data.
"Get the required data from t_cell_data.
MOVE-CORRESPONDING wa_t_cell_data TO it_ur_tab.
"Modify your internal table wih data
MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
ENDLOOP.
LOOP AT t_axis_data INTO wa_t_axis_data.
"Get the required data from t_cell_data.
MOVE-CORRESPONDING wa_t_axis_data TO it_ur_tab.
"Modify your internal table wih data
MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
ENDLOOP.
Thanks
Venkat.O -
How to read HyperLinks from pdf file??
hi developer's,
I am in PDF processing... I am having doubt in that Processing.
How to read Hyperlinks from PDF file?
I can able to set the hyperlink.. But i cant able to get the hyperlinks..
The following example program will set the hyperlink to the PDF file using lowagie API..
import com.lowagie.text.Anchor;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Paragraph;
import com.lowagie.text.html.HtmlWriter;
import com.lowagie.text.pdf.PdfReader;
import com.lowagie.text.pdf.PdfWriter;
public class Argu1 {
public static void main(String[] args) {
Document document = new Document();
try {
PdfWriter pdf = PdfWriter.getInstance(document,
new FileOutputStream("PageLink.pdf"));
PdfReader pdf_read=new
document.open();
document.add(new Paragraph("Hi Everbody....!"));
Anchor pdfRef = new Anchor("Click Me");
pdfRef.setReference("www.java2s.com");
Anchor rtfRef = new Anchor("Touch Me");
rtfRef.setReference("www.sun.com");
System.out.println(rtfRef.reference());
document.add(pdfRef);
document.add(Chunk.NEWLINE);
document.add(rtfRef);
} catch (DocumentException de) {
System.err.println(de.getMessage());
} catch (IOException ioe) {
System.err.println(ioe.getMessage());
document.close();
Help me how to read the Hyperlinks from the PDF file using java ...
Thanks in advance,
With Regards,
J.ImranInstead of cross-posting unformatted code you could have taken a look at the API, because there you might have come across a method named getLinks...Even though it's not documented, I really suspect that it will return the Hyperlinks on a given page.
-
Help me, How to read data from USB ???
Help me, How to read data from USB ???
If its a disk on key or some portable hard drive than once its connected to the usb and recognized by the system you can access it through java like you would access your hard drive.
-
How to filter Choose from list object rows?
Hi everyone,
I'd like to show Choose from list window using SBO 2005 PL07, Actually I want to show the Active Account of G/L Account, I set the CFL object to one column as following:
oCFLCreationParams.ObjectType = SAPbouiCOM.BoLinkedObject.lf_GLAccounts
oCFLCreationParams.UniqueID = "CFL"
oCFL = oCFLs.Add(oCFLCreationParams)
Who knows how to set Choose From list object only show Active Account and do not show Title Account.
Thanks for your help!
KathyHi kathy
I have not tried it on the gl accounts. But basicaly you need to add conditions to filter it. The following is an example that you would of used for business partners but only customers.
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
oCFLs = oForm.ChooseFromLists
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
' Adding 2 CFL, one for the button and one for the edit text.
oCFLCreationParams.MultiSelection = False
oCFLCreationParams.ObjectType = "2"
oCFLCreationParams.UniqueID = "CFL1"
oCFL = oCFLs.Add(oCFLCreationParams)
' Adding Conditions to CFL1
oCons = oCFL.GetConditions()
oCon = oCons.Add()
oCon.Alias = "CardType"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = "C"
oCFL.SetConditions(oCons)
oCFLCreationParams.UniqueID = "CFL2"
oCFL = oCFLs.Add(oCFLCreationParams)
The above also compensates for the tab.
Hope it helps -
How to read values from DMM4040
Hi,
I am using DMM4040, NI PXI 6509 device.
I need to make some port pins high which i have already done and now i have to read value captured by DMM then i have to make my port pins low if my value is within limits.
Can u suggest me how to read values from DMM and then by notification i ll make my port pins low.
'' A professional is someone who can do his best work when he doesn't feel like it''...........What language are you using? If using LabVIEW, you use the NI-DMM API to communicate with the 4040. Just take your reading, do your limit comparison, and set your lines based on the comparison results.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
JTable, how to read Data from it when enter is pressed
How to read Data from JTable on Return or lost focus from cell.
Also please tell me which listener I should should.
thx for helpYou should read the tutorial about tables, cell editors and models.
Also you should not [url http://forum.java.sun.com/thread.jsp?thread=472677&forum=57&message=2186815]crosspost
Mike -
Getting value of parameter from request object
If i submit a form using button element of html form then i dont get name of the button element as Parameter of request object and hence its value.
why and how?
Thanks in advancewhat do you mean submit a form with a button? You don't submit a form with a button, you submit it with a submit element. Unless you use Javascript to submit from an onclick handler in the button. In which case, you aren't submitting from the button, but from the script. I'm not sure that buttons are sent in forms. Why would they? If you are using buttons and Javascript, then you could use a hidden field and set it's value to the button's value when it's clicked before submitting the form.
Maybe you are looking for
-
To find the no of working days b/w given date
Hi ABAP Experts, Here i have one requirement . table is tfacs in this table i want to know the no of working days b/w the given date. Here i have attached my code .pls go through it and do me needful. TABLES : tfacs,vbrk
-
Applet loads in one jsp page and doesn't in the other
Hi, I've got a strange problem. I've written an applet which I want to embed in a jsp page in a web application. I've created a very small web application to simplify testing the applet, and all works well in it. But when I try to embed the applet in
-
Audio and Video is in iTunes not synchron. The files I use are normal podcast files from Swiss Television. What's going wrong?
-
How to avoid shared locks when validating foreign keys?
I have a table with a FK and I want to update a row in that table without being blocked by another transaction which is updating the parent row at the same time. Here is an example: CREATE TABLE dbo.ParentTable PARENT_ID int NOT NULL, VALUE varchar(1
-
Hi , Test case scenario : STA-AP Concurrent test case. 1. STAUT interface of CSR-DUT connected to Cisco-AP1252AG and T.P Ref Station Atheros-9462 connected to APUT-CSR. 2. Run Rx traffic between Cisco-AP1252AG to STAUT-CSR and Atheros to APUT-CSR ( i