Urgent - POST http form
Hello,
I am trying to upload a file and two string values by using this form.
<form method="post" enctype="multipart/form-data" action="./servlet/upload_media">
<td> <input type=file size=20 name="fname" > </td>
<td> <input type="hidden" name="pocketID" value="5326531"> </td>
<td> <input type="hidden" name= "username" value="something"> </td>
<td> <input type=Submit value=Upload> </td> </form>
The code i'm using to upload
public void UploadImage(byte[] image)
HttpConnection httpConn = null;
InputStream is = null;
OutputStream os = null;
try
HttpConnection c = (HttpConnection) Connector.open(url);
c.setRequestMethod(HttpConnection.POST);
String message1 = "--BbC04y"+"\n"+
"Content-Disposition: file; filename = \"0x0.png\" \n"+
"Content-Type: image/png; \n"+
"Content-Transfer-Encoding: binary\n\n";
String message2= "\n--BbC04y"+"\n"
+ "Content-Disposition: form-data; name=\"pocketID\"; value=\"130\" \n"
+ "Content-Disposition: form-data; name=\"username\"; value=\"dikaios\" \n";
byte[] Message1 = message1.getBytes();
byte[] Message2 = message2.getBytes();
int length = Message1.length + Message2.length + image.length;
c.setRequestProperty("User-Agent", "Profile/MIDP-2.0 Confirguration/CLDC-1.1");
c.setRequestProperty("Content-Length:",Integer.toString(length));
c.setRequestProperty("content-type", "multipart/form-data; boundary=AaB02x");
DataOutputStream dos = new DataOutputStream(c.openOutputStream());
for(int i=0; i < Message1.length; i++)
dos.writeByte(Message1);
for(int i = 0 ; i < image.length ; i++)
dos.writeByte(image[i]);
for(int i=0; i < Message2.length; i++)
dos.writeByte(Message2[i]);
The problem is that I get this error message
java.io.IOException: error 32 during TCP write
at com.sun.midp.io.j2me.socket.Protocol.writeBytes(+7)
at com.sun.midp.io.BaseOutputStream.write(+49)
at java.io.DataOutputStream.write(+10)
at com.sun.midp.io.j2me.http.Protocol.sendRequestBody(+190)
at com.sun.midp.io.j2me.http.Protocol.sendRequest(+42)
at com.sun.midp.io.j2me.http.Protocol.writeBytes(+61)
at com.sun.midp.io.BaseOutputStream.write(+49)
at com.sun.midp.io.BaseOutputStream.write(+18)
at java.io.DataOutputStream.write(+8)
at java.io.DataOutputStream.writeByte(+5)
at Servlets.ServletConnection.UploadImage(+186)
at UT.UT.startApp(+38)
at javax.microedition.midlet.MIDletProxy.startApp(+7)
at com.sun.midp.midlet.Scheduler.schedule(+270)
at com.sun.midp.main.Main.runLocalClass(+28)
at com.sun.midp.main.Main.main(+116)
The problem appears when I try to put the picture in the data output stream. It is the first time I do this, if I am doing something wrong when I constuct the form please let me know.
Regards
Dikaios
You can do it from anywhwere in the pipeline. You can use an assign action and modify the content of $body. Don't modify the whole variable.
If it still does not work, here is what I would do. Write a simple html file containing a submit and point to a service bus dummy proxy service. Inside the dummy service use a log action to log the content of $body so you have an idea how it should exactlty looks like.
Gregory Haardt
ALSB Prg. Manager
[email protected]
Similar Messages
-
Hi,
I need to emulate an HTTP form post from ALSB 2.5.
I have the business service defined as Text for both the Request and Response message types. I have a proxy that routes to the business service and sets the Content-type to 'application/x-www-form-urlencoded'.
But what I'm not clear on is how can I specify the form data set (name/value pairs) in the outbound HTTP request?
Thx in advance for the guidance!You can do it from anywhwere in the pipeline. You can use an assign action and modify the content of $body. Don't modify the whole variable.
If it still does not work, here is what I would do. Write a simple html file containing a submit and point to a service bus dummy proxy service. Inside the dummy service use a log action to log the content of $body so you have an idea how it should exactlty looks like.
Gregory Haardt
ALSB Prg. Manager
[email protected] -
Xml over http form post and response example
can some one point me to http form post/get syntax to send and receive xml...let me know
Use the cfhttp tag. For example, suppose the xmlDoc is already defined. Then you could post the document using
<cfhttp url="the_url" method="post">
<cfhttpparam type="header" name="content-type" value="text/xml">
<cfhttpparam type="header" name="content-length" value="#len(xmlDoc)#">
<cfhttpparam type="header" name="charset" value="utf-8">
<cfhttpparam type="xml" name="message" value="#xmlDoc#">
</cfhttp> -
Retrieve POST variables just like in a normal HTTP forms
Hi All :D
Can anyone tell me how to retrieve POST variables just like
in a normal HTTP form?
I have 2 flex applications. One will send the POST variables
and I would like the other to retrieve
these variables. How to implement this?
Thanks :D"JuggerOgre" <[email protected]> wrote in
message
news:g92bce$kgf$[email protected]..
> Hi All :D
>
> Can anyone tell me how to retrieve POST variables just
like in a normal
> HTTP
> form?
> I have 2 flex applications. One will send the POST
variables and I would
> like
> the other to retrieve
> these variables. How to implement this?
Flex is a client side application. You could send them from
one client and
then request them from the other client, or you could use
something like
BlazeDS to "push" the information.
HTH;
Amy -
Hi Everybody,
I'm having a Struts application that uses DynaValidatorForm for performing Validations.
The basic flow is like this -> I've got a home page, then a login page (action -> register.do) & a third page (action -> authenticate.do) which is displayed after authenticating the user.
I'm trying to re-direct the user to the home page once he directly accesses /authenticate.do
For this, in the Action class of /register, I'd defined a session attribute & set a value to it.
Then, in the Action class of /authenticate, I'm checking for the session attribute. If not present, I'm re-directing the user to home page.........
The problem that I'm facing is that when I directly access /authenticate.do, the application is not getting re-directed & instead, it is displaying error messages that User name & password (the 2 fields present in my login page) are required..........
The <action> tag of /authenticate.do has got validate="true" & hence it seems that validation occurs before re-directing....
Therefore, can someone tell me why is the application not posting the form to Action class of /authenticate........
Thanx in advance.....
Regards,
Sasidharan N<form name="input" method="get" action=""> <!-- ARE
YOU SURE YOU NEED "GET"
and not "POST"? -->
<table cellspacing="0" cellpadding="0" border="0"
width="300">
<tr>
<td><label for="proj_root">PROJECTROOT:
</label></td>
<td><input type="text" size="50" name="proj_root"
id="proj_root"></td>
</tr>
<tr>
<td><label for="frontend">FRONTEND:
</label></td>
<td><input type="text" size="50" name="frontend"
id="frontend"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit"
name="submit"
id="submit" value="Submit" onclick="save()"></td>
</tr>
</table>
</form>
(your form needs an action attribute value)
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"goober35" <[email protected]> wrote in
message
news:gcjmlh$p42$[email protected]..
> Hello,
> I am new in writing HTML code. I need help to align my
Form and it's text.
> Please view my code and please show me how to align all
the square boxes
> (the
> square box is where the user type the text input).
Currently I have 2
> boxes but
> they are not aligned. The below is my code:
>
> <FORM name="input" method="get" >
> PROJECTROOT: <INPUT TYPE=TEXT SIZE=50
NAME=proj_root> <br>
> FRONTEND: <INPUT TYPE=TEXT SIZE=50 NAME=frontend>
<br>>
> <BR>
> <INPUT TYPE=SUBMIT VALUE=Submit onclick="save()">
<BR>
>
> </FORM>
>
>
> Would you please help.
>
> Thank you very much
> Goober35
>
>
> <FORM name="input" method="get" >
> PROJECTROOT: <INPUT TYPE=TEXT SIZE=50
NAME=proj_root> <br>
> FRONTEND: <INPUT TYPE=TEXT SIZE=50 NAME=frontend>
<br>>
> <BR>
> <INPUT TYPE=SUBMIT VALUE=Submit onclick="save()">
<BR>
>
> </FORM>
> -
Error 500 when posting large form to windows azure from Android
I have a HTML page with a form containing a large (>1400 character) hidden field value, that will not submit on Android browser to any site hosted on windows azure websites. I have tested this on 4.1 and 4.2 on different devices.
I have checked the error logs from Azure and am receiving a 500 error.
The page will submit from all modern desktop browsers, and iOS devices.
Unfortunately I can not provide a link to the actual page, as it resides under our companies extranet, but if I point the target of this simple form to any Azure website (*.azurewebsites.net) from an android device, I get the 500 error.
<form action="http://*****.azurewebsites.net/" method="post">
<input type="hidden" name="imageData" value="/9j/4AAQSkZJRgABAQEAYABgAAD/4RuURXhpZgAATU0AKgAAAAgABQEyAAIAAAAUAAAASkdGAAMAAAABAAQAAEdJAAMAAAABAD8AAIKYAAIAAAAWAAAAXodpAAQAAAABAAAAdAAAANQyMDA5OjAzOjEyIDEzOjQ4OjM5AE1pY3Jvc29mdCBDb3Jwb3JhdGlvbgAABJADAAIAAAAUAAAAqpAEAAIAAAAUAAAAvpKRAAIAAAADMDIAAJKSAAIAAAADMDIAAAAAAAAyMDA4OjAyOjA3IDExOjMzOjExADIwMDg6MDI6MDcgMTE6MzM6MTEAAAAABgEDAAMAAAABAAYAAAEaAAUAAAABAAABIgEbAAUAAAABAAABKgEoAAMAAAABAAIAAAIBAAQAAAABAAABMgICAAQAAAABAAAaWgAAAAAAAABgAAAAAQAAAGAAAAAB/9j/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAB4AKADASEAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDv9tJtr6C54obaTbRcQm2kK07gJtpNtO4hNtJtqrisJtpu2nckQrTdtNMTE20mynckbtpNtVcQ3bTdlO5DNvbRtrjudomKNtFxCbaTbTuITbTX2opZiAo6moqVoUoOpUdkt2OMJTkoxV2wVd8e9QcZ7qR"
/>
<input type="submit" />
</form>
To further test this I created a brand new site on azure websites, leaving everything as default. No code or anything uploaded (so you get the "This web site has been successfully created" page). Posting the form to this site gives a 405 response
(as expected), except for android that gives the 500.
Is there a setting or something I am missing somewhere?
Following up, I have identified this event in the error log if this helps:
138. GENERAL_READ_ENTITY_END
BytesReceived="0", ErrorCode="The I/O operation has been aborted because of either a thread exit or an application request.
(0x800703e3)".Originally I thought it may have been a browser issue, so I installed the latest Chrome and Firefox browsers as well, which all respond the same.
This is on 2 separate devices, both modern hardware running Android v4.1 and v4.2 -
Hi,
I am really struggling with HTTP data submission from a LiveCycle form.
There seems to be loads of code samples for ColdFusion, but nothing for ASP/ASP.net - all I am looking to do is submit the data, post a response back to the user confirming it has been received and save the posted data to a DB.
I have used the standard request command, but when I post the form I am just getting a general error.
Can anyone help with some code snippets that will get me going on this?
Many thanks in advance.
GarethWe have a separate forum for Designer. Please repost in the LiveCycle Designer forum.
-
How to fill out POST HTML forms from my Java Application?
Hi -
I am writing a little Java GUI program that will allow a user to fill out data from the GUI and then submit that data. When they submit the data (two text fields) I want to take the two text fields and submit them via the POST form method of a HTML document over the web.
Here is what I got so far:
host = new URL("http", "<my_address>", web port, "/query.html");
InputStream in = host.openStream();
BufferedInputStream bufIn = new BufferedInputStream(in);
for (;;)
int data = bufIn.read();
// Check for end of file
if (data == -1)
break;
else
System.out.print ( (char) data);
}What that code does is makes a URL, opens a stream, and reads the HTML source of the file at the specified URL. There is a form that submits data via the POST method, and I would like to know how to write data to specific forms and specific input types of that form.
Then, I'd like to be able to read the response I get after submitting the form.
Is this possible?
Thanks,Here is how one of my e-books go about Posting
I tryied in one of my projects and it works ok
(Tricks of the Java Programming Gurus)
There's another reason you may want to manipulate a URLConnection object directly: You may want to post data to a URL, rather than just fetching a document. Web browsers do this with data from online forms, and your applets might use the same mechanism to return data to the server after giving the user a chance to supply information.
As of this writing, posting is only supported to HTTP URLs. This interface will likely be enhanced in the future-the HTTP protocol supports two ways of sending data to a URL ("post" and "put"), while FTP, for example, supports only one. Currently, the Java library sidesteps the issue, supporting just one method ("post"). Eventually, some mechanism will be needed to enable applets to exert more control over how URLConnection objects are used for output.
To prepare a URL for output, you first create the URL object just as you would if you were retrieving a document. Then, after gaining access to the URLConnection object, you indicate that you intend to use the connection for output using the setDoOutput method:
URL gather = new URL("http://www.foo.com/cgi-bin/gather.cgi");
URLConnection c = gather.openConnection();
c.setDoOutput(true); Once you finish the preparation, you can get the output stream for the connection, write your data to it, and you're done:
DataOutputStream out = new DataOutputStream(c.getOutputStream());
out.writeBytes("name=Bloggs%2C+Joe+David&favoritecolor=blue");
out.close();
//MY COMMENT
//This part can be improved using the URLEncoder
//******************************************************You might be wondering why the data in the example looks so ugly. That's a good question, and the answer has to do with the limitation mentioned previously: Using URL objects for output is only supported for the HTTP protocol. To be more accurate, version 1.0 of the Java library really only supports output-mode URL objects for posting forms data using HTTP.
For mostly historical reasons, HTTP forms data is returned to the server in an encoded format, where spaces are changed to plus signs (+), line delimiters to ampersands (&), and various other "special" characters are changed to three-letter escape sequences. The original data for the previous example, before encoding, was the following:
name=Bloggs, Joe David
favoritecolor=blue If you know enough about HTTP that you are curious about the details of what actually gets sent to the HTTP server, here's a transcript of what might be sent to www.foo.com if the example code listed previously were compiled into an application and executed:
POST /cgi-bin/gather.cgi HTTP/1.0
User-Agent: Java1.0
Referer: http://www.foo.com/cgi-bin/gather.cgi
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Content-type: application/x-www-form-urlencoded
Content-length: 43name=Bloggs%2C+Joe+David&favoritecolor=blue
Java takes care of building and sending all those protocol headers for you, including the Content-length header, which it calculates automatically. The reason you currently can send only forms data is that the Java library assumes that's all you will want to send. When you use an HTTP URL object for output, the Java library always labels the data you send as encoded form data.
Once you send the forms data, how do you read the resulting output from the server? The URLConnection class is designed so that you can use an instance for both output and input. It defaults to input-only, and if you turn on output mode without explicitly setting input mode as well, input mode is turned off. If you do both explicitly, however, you can both read and write using a URLConnection:
c.setDoOutput(true);
c.setDoInput(true); The only unfortunate thing is that, although URLConnection was designed to make such things possible, version 1.0 of the Java library doesn't support them properly. As of this writing, a bug in the library prevents you from using a single HTTP URLConnection for both input and output.
//MY COMMENTS
When you doing URL encoding
you should not encode it as one string becouse then it will encode the '=' signes and '&' signes also
you should encode all the field names and values seperatly and then join them using '&'s and '='s
Ex:-
public static void addField(StringBuffer sb,String name, String value){
if (sb.length()>0){
sb.append("&");
sb.append(URLEncoder.encode(name,"UTF-8"));
sb.append("=");
sb.append(URLEncoder.encode(value,"UTF-8"));
} -
How to post a form to a servlet in CQ5.5?
Hi all,
I'm using CQ5 to develop some things. and now i am not so clearly how to post a 'FORM' and accept with a SERVLET.
I've seen this 'http://forums.adobe.com/message/4932739#4932739' already, and try it. But once i add a new <input /> like :<input name="age" value="age" />.
and i submit this form, then tell me error: javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {}age
see the code
jsp:
<!-- String action = /content/myproject/en/thanks -->
<form id="submitForm" method="post" action="<%= action %>.POST.html" onsubmit="return validate();">
<input type="hidden" name=":redirect" value="<%=resourceResolver.map(action)%>" />
<input type="hidden" name=":formpath" value="<%=currentNode.getPath()%>" />
<input type="hidden" name=":formtype" value="<%=component.getResourceType()%>" />
<input type="hidden" name="_charset_" value="utf-8" />
<input name="age" value="26" /> <!-- if i comment this line, it can submit success, otherwise show me Status: 500. -->
<input type="submit" value="Submit"/>
</form>
servlet:
@Component(immediate = true, metatype = false, label = "QuestionnaireServlet")
@Service
@Properties(value = {
@org.apache.felix.scr.annotations.Property(name = "sling.servlet.methods", value = { "POST" }),
@org.apache.felix.scr.annotations.Property(name = "sling.servlet.resourceTypes", value = { "sling/servlet/default" }),
@org.apache.felix.scr.annotations.Property(name = "sling.servlet.selectors", value = { "POST" }),
@org.apache.felix.scr.annotations.Property(name = "sling.servlet.extensions", value = { "html" })
public class QuestionnaireServlet extends SlingAllMethodsServlet implements
OptingServlet {
protected void doPost(SlingHttpServletRequest request,
SlingHttpServletResponse response) throws ServletException,
IOException {
//it seems never call this function.
can anybody told me in details ?1).open the system/console/bundles and i can see the information of my servlet. include 'Symbolic Name', Version, Bundle Location, Exported Packages and so on. I think it already a service. right ?
2). change the selector to QAPOST for sling.servlet.selectors
3). add the slash "/" then submit and the browser show me "403 Forbidden"
4). without slash "/" before <action_attr_value>.POST.html, show me 'Status: 500', Message: javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {}age -
POST http(s) request with xml content in Power Query
I have a POST http request which works good in HttpRequester (Firefox plugin). I know that it is possible to call POST request in Power Query but cannot find working solution. Here is the original request:
POST https://svcs.ebay.com/FeedbackService
X-EBAY-SOA-OPERATION-NAME: createDSRSummaryByPeriod
X-EBAY-SOA-SERVICE-VERSION: 1.0.0
X-EBAY-SOA-SERVICE-NAME: FeedbackService
X-EBAY-SOA-APP-NAME: ***
X-EBAY-SOA-SITEID: 0
X-EBAY-SOA-SECURITY-TOKEN: ***
Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
<createDSRSummaryByPeriodRequest xmlns="http://www.ebay.com/marketplace/services">
<dateRange>
<dateFrom>2013-12-01T00:00:00.000Z</dateFrom>
<dateTo>2013-12-31T23:59:59.999Z</dateTo>
</dateRange>
<dateRangeEventType>ListingDate</dateRangeEventType>
</createDSRSummaryByPeriodRequest>
Power Query WebContent() function is capable to handle headers and xml content, however, there is no any documentation about its syntax.
In Power Query I use this request:
= Xml.Tables(Web.Contents(“https://svcs.ebay.com/FeedbackService”,
[Headers =[" X-EBAY-SOA-OPERATION-NAME"= "createDSRSummaryByPeriod",
"X-EBAY-SOA-SERVICE-VERSION="1.0.0",
"X-EBAY-SOA-SERVICE-NAME"="FeedbackService",
"X-EBAY-SOA-APP-NAME"="***","X-EBAY-SOA-SITEID"="0",
"X-EBAY-SOA-SECURITY-TOKEN"="***"],
Content=["<?xml version="1.0" encoding="UTF-8"?>
<createDSRSummaryByPeriodRequest xmlns="http://www.ebay.com/marketplace/services">
<dateRange>
<dateFrom>2013-12-01T00:00:00.000Z</dateFrom>
<dateTo>2013-12-31T23:59:59.999Z</dateTo>
</dateRange>
<dateRangeEventType>ListingDate</dateRangeEventType>
</createDSRSummaryByPeriodRequest>"]]))
However, it returns "Expression.SyntaxError: Invalid identifier." Maybe anyone has at least examples of analogous working syntax?Task is solved. First of all I updated PowerQuery since previous version does not support Headers option for Web.Contents function. Here is a correct syntax:
=Xml.Document(Web.Contents("https://api.ebay.com/ws/api.dll",[Headers=[#"X-EBAY-API-COMPATIBILITY-LEVEL"= "871",#"X-EBAY-API-SITEID"="0",#"X-EBAY-API-CALL-NAME"="GetMyeBaySelling",#"CONTENT-TYPE"="text/xml"], Content=Text.ToBinary("<?xml version="&Character.FromNumber(34)&"1.0"&Character.FromNumber(34)&" encoding="&Character.FromNumber(34)&"utf-8"&Character.FromNumber(34)&"?>
<GetMyeBaySellingRequest xmlns="&Character.FromNumber(34)&"urn:ebay:apis:eBLBaseComponents"&Character.FromNumber(34)&">
<RequesterCredentials><eBayAuthToken>***</eBayAuthToken></RequesterCredentials><SoldList><DurationInDays>60</DurationInDays><Pagination><EntriesPerPage>100</EntriesPerPage><PageNumber>1</PageNumber></Pagination></SoldList></GetMyeBaySellingRequest>")])) -
Business Connector 4.8 post http 1.0 1.1
Hello,
I have one problem,
I must post an xml file to a external server wich only use post http 1.1
I have traced my tcp stream an i see, that the BC service "http" use http 1.0.
Is it possible to give this service any paramter so that he use 1.1
Or have anyone build an new java service the use http 1.1?
regards
Florian Martin
Edited by: Florian Martin on May 18, 2009 1:34 PMThe source code of the http service is not available.
But i think i can write a new Java service.
I don't now why it is not compatible.
This is the first time we have this problem.
The customer tells me, that his server only understand http 1.1
4.7 and 4.8 are nearly the same
In 4.8 a lot of the java services will updatet.
The most of the changes are bugfix.
Thanky for your answers guys.
Then i will try to create a new java service
Regards
Florian
Edited by: Florian Martin on May 19, 2009 1:16 PM -
Urgent , Post or Get method?
hello all;
when i deploy a servelt on growser with the GET method , the servlet is working all right, but when i use POST method (to change database) , i have error , please tell me how and when i use Post method?GET and POST are two different ways of passing data from a browser to a server. With the GET method, the browser constructs a Query String (?var1=val&var2=val...) which is passed to the server as part of the URL. With the POST method, the data from the browser is passed via standard input to the server. You determine which method is used when you build the HTML form:
<FORM ACTION="/path/action_servlet" METHOD="POST">
OR
<FORM ACTION="/path/action_servlet" METHOD="GET">
<INPUT TYPE="TEXT" NAME="var1">
<INPUT TYPE="TEXT" NAME="var2">
<INPUT TYPE="SUBMIT">
</FORM>
In the case of servlets, either the doGet() or doPost() method will be executed depending on how the data is passed from the browser.
In general, use the GET method for debugging or if you want the client to be able to bookmark the entire URL (with parameters). If you have an application where you are "changing the database", you probably want to use the POST method.
-- Brian
null -
Hi,
I know that it may be silly question but I don't know which class I should use inside servlet to get the name of the HTTP form?What do you mean exactly with "HTTP form" ? There is no such thing ..
If you mean the HTML form like as <form name="formName">then no, you cannot. Rather add a hidden input element to the form with the form identifier in it. -
Post HTML form..OIM
Hi,
In,The external application the password is encrypted with an unknown algorithm, additionally it is encrypted within the application and then stored encryoted in the Oracle database. Requires OIM to pass the UserID of the user , Old and New Password, and a appliaction Password Change Wrapper to change the password in external application and send to application DB. Admin PW reset will utilize a service ID with ID/PW Admin privileges.
Here ,when admin changes password in OIM, he dont need to put old password , he just enters new password but for our application it needs to know old password,Can I get it in OIM??
Another approach I am thinking is we have another application in sync with it, and there password is decrypted, so when the admin clicks the change password button, post a form with userd of the user and and service userid and password and then send to the application and it will pick it up and return the error or success code to OIM? Does it is feasible in OIM? To post a HTML form?
ThanksYou can implement a Thread that creates the URL string with all the parameters and opens the URL connection after which it sleeps for the particular duration (10 mins in your case).
-
Urgent :post xml for xsql difference with html form post
Hi,
We are developing an application to process xml request
posted by external party. The requests arrive by
http-post operation
We developed and tested with an html-form.
Now we encounter problems in testing with http-post
The xsql page is processed correctly but
insert only fixed text when formatting xml-data as input for
the insert-request, string inserted is empty.
Everything is by the book and html-forms works great.
Is anybody else using xsql to insert xml data in the database on this version? Maybe can you help by looking into a testcase ? Issued a tar but am on terrible deadline
so need help very soon.
Details: HP-UX 11.11 Oracle 9.2.0.4 java1.4 ojdbc 1.4
Tnx in advance,
JeroenMark,
Have an external partner which sends xml-requests.
Have to read those, store them and process them.
Idea is let them
1)post the xml at a url where an xsql page is reading the xml
2) transforming this for an insert into
the database. The column is defined to store the complete xml-message.
3) A trigger takes care of processing the stuff and preparing the output
4) and a query in the xsql-page reads the output from an output table
When developing and testing this with an html-form that posts the xml is works great.
$ cat newclobins.xsql
<?xml version="1.0"?>
<page connection="demo" xmlns:xsql="urn:oracle-xsql" >
<xsql:set-session-param name="id">
select msgid.nextval from dual
</xsql:set-session-param>
<xsql:dml>
delete cbs_msg_in where id={@id}
</xsql:dml>
<xsql:insert-request table="cbs_msg_in" column="id,msg" transform="cbsform_1.xsl"/>
<data>
<xsql:query null-indicator="yes">
select msgid,msg from cbs_xml_out where msgid={@id}
</xsql:query>
</data>
</page>
$ cat cbsform_1.xsl
<?xml version="1.0"?>
<ROWSET xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
<xsl:for-each select="request">
<ROW>
<MSG><xsl:value-of select="parameters/doc" /></MSG>
<ID><xsl:value-of select="session/id" /></ID>
</ROW>
</xsl:for-each>
</ROWSET>
1) When using a tool like
http://www.programmersheaven.com/articles/adrian/getpost/article.html it fails with
No rows to modify -- the row enclosing tag missing. Specify the correct row enclosing tag.
2) When using the commandline utility like
xsql jeroen5.xsql posted-xml=test3.xml
this works great when inserting plain text but not
when inserting xml-format data into a column
So problem 1 is why external tools like above or my partner that uses .net to do something similar gives this strange error?
Problem nr 2 is should I stick to just the data in xml and forget about storing the xml-formatted data?
Hope you can help because I am getting quite desparate here.
Regards,
Jeroen
Maybe you are looking for
-
Restoring From Time Machine Migration Assistant (and other ??)
Hello Please bear with me on this long question.... For several reasons I reinstalled ML which involves erasing the HDD first. I do have everything bakced-up to Carbonite and TM. Carbonite is slow as molassess so I opted to try Migration Assistant/
-
I installed jre1.3.1_09 version. when iam trying to execute javac, it says "Error: could not find Java 2 Runtime Environment.". i have set the classpath for all the jar files under lib directory. so please suggest me to get rid of this problem.
-
How do I force all Tabs to the right hand side, leaving space on the left?
It feels more intuitive to have the first tab against the right hand side and it's easier to find because it always remains in the same position when, eg, closing other tabs. I use TabMixPlus, but can't find the required option. Many thanks.
-
Hi all, We are having a performance problem in MB51. Sometimes we got the "TIME_OUT" error. Is there anyway we can improve the performance of MB51. Looking forward for your feedback. Thanks in advance. Regards, Kim Hoong, Ng
-
Activity values of object K_KA_RPT
Hi all, I'm working on authorization for t-code KE80. I'v found suspicious activity values of object K_KA_RPT as following: L0 All functions L1 Function range level 1 L2 Function range level 2 Would you please explain me about these value