Form method=post - Nevermind, I fixed it.
I have a weird problem.
If I make the form method=get, then everything works fine when I submit the form. However, when I make form method=post, I get this error message when I try to submit the form:
Your request cannot be completed. The server got the following error:
javax.servlet.jsp.JspTagException
Does anyone have any idea why this would happen?
Thanks for your time. Any help is greatly appreciated.
Message was edited by:
user449101
Nevermind, I found my problem.
Similar Messages
-
OC4J Form method="post" don't working
Hello!
I have a J2EE Application with Servlets and jsp's, with OC4J v.10.1.3 installed in my computer, with one page called index.jsp with this code:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.Enumeration"%>
<%
String auth = request.getHeader("Authorization");
String usuario = "";
if (auth == null) {
response.setStatus(response.SC_UNAUTHORIZED);
response.setHeader("WWW-Authenticate", "NTLM");
return;
if (auth.startsWith("NTLM ")) {
byte[] msg =
new sun.misc.BASE64Decoder().decodeBuffer(auth.substring(5));
int off = 0, length, offset;
if (msg[8] == 1) {
off = 18;
byte z = 0;
byte[] msg1 =
{(byte)'N', (byte)'T', (byte)'L', (byte)'M', (byte)'S',
(byte)'S', (byte)'P', z,
(byte)2, z, z, z, z, z, z, z,
(byte)40, z, z, z, (byte)1, (byte)130, z, z,
z, (byte)2, (byte)2, (byte)2, z, z, z, z, //
z, z, z, z, z, z, z, z};
response.setStatus(response.SC_UNAUTHORIZED);
response.setHeader("WWW-Authenticate", "NTLM "
+ new sun.misc.BASE64Encoder().encodeBuffer(msg1).trim());
return;
else if (msg[8] == 3) {
off = 30;
length = msg[off+17]*256 + msg[off+16];
offset = msg[off+19]*256 + msg[off+18];
usuario = new String(msg, offset, length);
//out.println(s + " ");
else
return;
length = msg[off+1]*256 + msg[off];
offset = msg[off+3]*256 + msg[off+2];
usuario = new String(msg, offset, length);
//out.println(s + " ");
length = msg[off+9]*256 + msg[off+8];
offset = msg[off+11]*256 + msg[off+10];
usuario = new String(msg, offset, length);
usuario = usuario.replaceAll(" ", "");
usuario = usuario.trim();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
function enviarForm() {
document.frmLogin.submit();
return true;
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Mapfre Asistencia</title>
</head>
<body onload="javascript:enviarForm();return true">
<form name="frmLogin" method="post" action="/mapfre_content/ConectorOCDB" enctype="application/x-www-form-urlencoded; charset=UTF-8">
<%
Enumeration num = request.getParameterNames();
while (num.hasMoreElements()) {
String param = (String) num.nextElement();
String valor = request.getParameter(param);
request.getSession().setAttribute(param, valor);
%>
<input type="hidden" name="<%=param%>" value="<%=valor%>"/>
<% } %>
<input type="hidden" name="user" value="<%=usuario%>"/>
</form>
</body>
</html>
The first part is to obtain the Windows username and last, the part to generate the form dinamically, because the number of parameters may vary, well, all works perfectly but when I send the form to the Servlet, the parameters value appears as NULL.
Curiosly, the parameters arrives well if I change the form method to GET, ¿what's wrong with this code or with the server configuration?
Thank You!!set the form to multipart/form-data (required for file uploads, as a little research could have told you) and use Apache FileUpload to parse the request.
-
ERROR RENDERING PDF IN SERVLET WITH FORM method="post"
Hello,
we are trying to render a dinamic PDF document in a servlet building with XSL:FO apache or itext.
The problem ocurs when we sending a Form data with method post, the output of the servlet is a blank page instead of the pdf document. Also if we send the form data with method "get" we can view the pdf document corretly.
But we need to send amount information, and can?t use method get.
ThankYou can always use GET to send information by generating a dynamic URL in the query string (after the '?'). Granted, you don't want to send file data that way, but it will work for small numbers of arguments where privacy is not a concern.
As to why you see the PDF in one instance and not another, I'm not sure. There is no difference from an HTTP standpoint. You sent a request, you are getting a response. The browser should treat the response the same, regardless of GET vs POST.
Are you setting the content-type to application/pdf? Are you doing something fishy with Javascript? Do you have conditional logic in your code that fires on a POST but not on a GET that actually has a bug in it (since GET works but it was designed for POST)?
- Saish
"My karma ran over your dogma." - Anon -
Setting form method to POST to hide URL using WWW_GET_REPORT with webrfc
I want to hide the URL details when running webrfc reports. The link contains information that we want to hide form the user.
Is there a way of setting the form method to POST rather than GET when running a report using webrfc function WWW_GET_REPORT.
Thank you
Karenyes its possible.
for example, if you have a report with a selection screen parameter called abc .
(parameters: abc(10) .)
then the code would be
form method="POST" action="http://abaphost.domain.com:1080/sap/bc/webrfc?sap-client=001" >
input name="PARC_ABC" size= 10 maxlength= 10 >
input type=hidden name= _FUNCTION size= 30 value= WWW_GET_REPORT >
input type=hidden name= _REPORT size= 30 value= Y_TEST_WEBRFC >
input type="submit" value="Execute report">
/form>
Regards
Raja -
HTTP Status 405 - HTTP method POST is not supported by this URL
dear all
can u solve my problem.am getting the *"HTTP Status 405 - HTTP method POST is not supported by this URL"* msg from the browser when i press the search button in my form.plz suggest me the solution for my fault.these are the following html,xml,class files:
search.html*
<html>
<head>
<title>Search Page</title>
</head>
<body>
<p align="center"><font size="6" color="#0000FF"><b>Search Module</b></font></p>
<p align="center"> </p>
<center>
<form method="POST" action="./emp">
<table border="1" width="43%">
<tr>
<td width="50%">
<p align="right">Employee Name</td>
<td width="50%"><input type="text" name="empname" size="36"></td>
</tr>
<tr>
<td width="100%" colspan="2">
<p align="center"><input type="submit" value="Search" name="B1"></td>
</tr>
</table>
</form>
</center>
</body>
</html>
web.xml*
<web-app>
<servlet>
<servlet-name>jdbc</servlet-name>
<servlet-class>searchModule</servlet-class>
<init-param>
<param-name>driver</param-name>
<param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
</init-param>
<init-param>
<param-name>url</param-name>
<param-value>jdbc:odbc:first</param-value>
</init-param>
<init-param>
<param-name>user</param-name>
<param-value>scott</param-value>
</init-param>
<init-param>
<param-name>pass</param-name>
<param-value>tiger</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>jdbc</servlet-name>
<url-pattern>/emp</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>search.html</welcome-file>
</welcome-file-list>
</web-app>
SearchModule.java*
import java.util.*;
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class searchModule extends HttpServlet
Connection con;
public void init() throws ServletException
String d=getInitParameter("driver");
String u=getInitParameter("url");
String us=getInitParameter("user");
String pwd=getInitParameter("pass");
try
Class.forName(d);
con=DriverManager.getConnection(u,us,pwd);
catch(ClassNotFoundException e)
System.out.println(e);
catch(SQLException e)
System.out.println("Unable to establish the connection");
}//init
public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
String empname=req.getParameter("empname");
res.setContentType("text/html");
PrintWriter pw=res.getWriter();
try
pw.println("<html><body><center>");
Statement st=con.createStatement();
String sql="select * from employee where empname="+empname;
ResultSet rs=st.executeQuery(sql);
if(rs.next())
pw.println("<h2>Employee Details</h2>");
pw.println("<table border=1>");
pw.println("<tr><th>Employee No.</th>");
pw.println("<th>Employee Name</th>");
pw.println("<th>Designation</th>");
pw.println("<th>Department</th>");
pw.println("<th>Salary</th>");
pw.println("</tr><tr>");
pw.println("<td>"+rs.getInt(1)+"</td>");
pw.println("<td>"+empname+"</td>");
pw.println("<td>"+rs.getString(3)+"</td>");
pw.println("<td>"+rs.getString(4)+"</td>");
pw.println("<td>"+rs.getInt(5)+"</td>");
pw.println("</tr></table>");
else
pw.println("<h2>Employee Record Not Found</h2>");
pw.println("</center></body></html>");
pw.close();
rs.close();
st.close();
catch(SQLException e)
System.out.println(e);
}//doPost
public void destroy()
if(con!=null)
try
con.close();
catch(Exception e)
System.out.println("Connection Closed");
}//destroy
}//searchModule
in control panel i selected System DNS and created the name as first and driver as Microsoft ODBC for Oracle
plz suggest me the solution where i committed mistake.<form method="*POST*" action="./emp">
public void doGet (HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
HTTP method POST is not supported by this URL -
I need a button which does the following HTML,
<form method="post"
action="http://abc.com/etc&etc&etc">
<input name="ServiceTag" value="<this value is read from the DB>" type="hidden" />
<input name="logout" value="" type="hidden" />
<input type="submit" value="Support Agreement" />
</form>
The button should open a new window.
I have seen examples of javascript, but I think the important bit here is the method="post"
Any help would be much appreciated.
Paul
Found that I could add the serial number to the url and perform http get, rather than a post.
Message was edited by:
pjflynnHi
Is JavaProgram a Applet or Servlet?
Opening a new window directly from server,probably not possible? From your question
what I understand is, A html page is displayed
and when u click on a link opens a new window.
The parameters to the link should be posted using POST method, again
it is not possible this can be done only by appending
"?name1=value1&name2=value2..."to the link
Vinay
[email protected] -
How to send Parameters FORM to PHP WEB Page with method POST (secure)?
Hello everyone,
i hope someone can help me to find a solution to this problem!
i have to send "+precious+" parameters from an oracle form to php page, like username and password, with a secure method... i tried with WEB.SHOW_DOCUMENT procedure but it uses GET Method and when the web page open up you can read those parameters in the url...no good!
some suggestion?
Thank a lot in advance... FMicioThe other way you have is to make a PJC java bean ...
which uses HTTPClient library..
for example:
PostMethod post = new PostMethod("http://jakarata.apache.org/");
NameValuePair[] data = {
new NameValuePair("user", "joe"),
new NameValuePair("password", "bloggs")
post.setRequestBody(data);
// execute method and handle any error responses.
InputStream in = post.getResponseBodyAsStream();
// handle response.I have done a multipart form data post to upload files to my db over httpClient.. and other things...
Or with java.net.* api-s
try {
// Construct data
String data = URLEncoder.encode("key1", "UTF-8") + "=" + URLEncoder.encode("value1", "UTF-8");
data += "&" + URLEncoder.encode("key2", "UTF-8") + "=" + URLEncoder.encode("value2", "UTF-8");
// Send data
URL url = new URL("http://hostname:80/cgi");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(data);
wr.flush();
// Get the response
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
while ((line = rd.readLine()) != null) {
// Process line...
wr.close();
rd.close();
} catch (Exception e) {
}Or you can call your web page (post data) from your database
http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/
Edited by: Peterv6i on Mar 30, 2012 3:49 PM
Edited by: Peterv6i on Mar 30, 2012 3:55 PM -
Method post and encrypt problem--FORM
Hello,
In the form I have some text fields and one field which takes input as file.
Now I have set method = post and enctype="multipart/form-data" for a form.
Now when I submit the form the input = text fields are shown as null since I am using enctype="multipart/form-data".
I have to use enctype="multipart/form-data" since I have to send a file.
I dont understand how to solve this problem.
Thanks
AnikethI am using the same library for file upload.
There are some input type as text and one input type as file.For input type file I have use enctype="multipart/form-data".
As I explained above if I use the form parameter enctype="multipart/form-data" only then the file will be uploaded but the other text inputs (which I read as request.getParameter("name"))comes out to be null.
Please help me out -
Creating the JSPDynPage ( form name="myFormName" method="post" action=""
Hi All,
I am developing JSPDynPage example ,in this example i am using html tags instead of business HTML . So when i am submitting the JSP page , what is the name of the action i have to set in action method.
So please provide me detailed information for the above query and that would be greatly appreciated
Regards
Siva
This is my java class :
public class test extends PageProcessorComponent
below i am posting the my jsp page code:
<jsp:useBean id="myBean" scope="request" class="test.testmyBean" />
<hbj:content id="myContext" >
<hbj:page title="PageTitle">
<form name="myFormName" method="post" action="">
<input type="text" name="T1" size="20" value="<%=(myBean == null)?"":myBean.getText()%>">
<input type="submit" value="Submit" name="B1" onClick="javascript:fntCheck();">
</form>
<script language="javascript">
function fntCheck()
document.myFormName.submit();
</script>
</hbj:page>
</hbj:content>Hi Siva,
We can use <hbj:form> tag in our HTML code. So use <hbj:form> tag in place of normal HTML <form> tag and place a <hbj:button> tag in the hidden part of the HTML code.
When the user clicks on the HTML button, at that time call javascript to trigger the <hbj:button> button. This will submit the form to the server as the same way as submitting the page of HTMLB.
We implimented this in our project.
Follwing are the steps to do:
1. Replace <form> tag with<b><hbj:form></b> tag.
2. Add the follwing code in your JSP.
<b><div style="visibility:hidden;">
<hbj:button
id="Update"
encode="false"
text="Update"
width="125px"
tooltip="Click here to update address data."
onClick="Update"
disabled="false"
design="STANDARD"
jsObjectNeeded="TRUE"
/>
</div></b>
3. Add the follwing line of code in <u>'fntCheck()' </u>javascript function.
<b>
var funcName = htmlb_formid+"_getHtmlbElementId";
func = window[funcName];
var buttonUpdate = eval(func("Update"));
document.getElementById(buttonUpdate.id).onclick();</b>
Deploy & Run.
Cheers....
Satya -
Geting values in a form with post method
heloo all
hi
i am creating a website, in my website i am developing a discussion forum
now i am stucked ....
in the discussion forum there is a reply option for all discussions
exatly the way it has for this java technology forum and when one clicks the reply ,a html form comes (same as in this case) with a topic text box and a message text area
now my problem is i want the topic text box to be filled with the topic of the discussion
but since the method of the form is post it cannot take any values
can any one give a solution
thanks 4 ur timeHi,
As the user clicks on the reply link, associate the topic parameter or the topic name with it in the hyperlink.
Like :
http:\\localhost:8080\jspdemo.jsp?topic_no=<<topic_no>>&any_other_parameter=<<parameter>>
Now, according to your coding perspectives, you can make jspdemo.jsp as a jsp to access the topic name from the database given the topic no. Or, the topic name can directly be associated as a parameter, which can be send to the form jsp page. But using jsp is necessary.
Hope this helps.
Regards,
Deepa -
HTTP method POST is not supported by this URL
Hi everyone,
I'm having a problem in my application.
I used the ADF Security Wizard to enable the ADF Security in my application. So, it created the pages login.html, error.html and welcome.jsp.
The problem is when I try to sign in in my applicaton. On the page login.html I filled in the fields username and password and click on the button to post the form. But when the form is posted I get the message: "HTTP method POST is not supported by this URL".
The form is posted to the bean j_security_check.
Does anybody know why is it happening? What should I do to fix it?
Thanks a lot
Daniel
Edited by: [email protected] on 23/02/2010 05:37Normally when you get this error, your username/password is not correct.
It's not a clean way of errorhandling. I have had the same issue and after a while i noticed the password i entered was not correct. -
How to use method POST to send XML using utl_http?
Hi,
I am trying to work out how to use the POST method to mimic submitting data from a HTML form, using utl_http.
I cannot use SOAP for this as the people I am sending the data to are just expecting an XML document to be sent to a standard CGI script running on their web server.
There is a lot of documentation on how to submit data using the POST method (using Utl_Http.Write_Text etc), but I cannot find anything that tells me how to submit form variables.
The examples on OTN say this:
"Alternatively use method => 'POST' and Utl_Http.Write_Text to
build an arbitrarily long message"
but don't tell me how to actually place the data into the required input parameters of the CGI program I am hitting.
I need to hit a URL such as
www.asite.com/cgiprogram
and pass in a parameter, eg
in_param="test+data"
I am currently doing this as a GET, which works, but the XML document I am passing in could potentially be bigger than the GET method will allow.
Any help would be greatly appreciated.
Thanks,
Leon.Please try the PL/SQl forum
-
BADI ME_PROCESS_PO_CUST Method Post
Hi, how can we know in the method post of the BADI ME_PROCESS_PO_CUST if we are in creation mode (me21n) or change mode (me22n), I need to do some coding only at the creation of the PO but this method is call anytime we click save!
thanks!Hello Alexandre
It would be possible to check the transaction. However, if the BAPI BAPI_PO_CREATE is used the BAdI is also processed yet the transaction is most likely wrong.
An <u>unambigous </u>approach is to check IMPORTING parameter IM_TRTYP in method IF_EX_ME_PROCESS_PO_CUST~OPEN:
METHOD if_ex_me_process_po_cust~open.
* define local data
DATA:
lo_po TYPE REF TO cl_po_header_handle_mm,
ls_header TYPE mepoheader.
me->md_trtyp = im_trtyp. " save transaction type
IF ( im_trtyp = 'H' ). " add new purchase order
I would add an instance attribute MD_TRTYP to the BAdI implementing class and save the transaction type in method IF_EX_ME_PROCESS_PO_CUST~OPEN (see above).
Now you can simply add the following IF condition to your POST method:
METHOD if_ex_me_process_po_cust~open.
CASE me->md_trtyp.
WHEN 'H'. " add new purchase order
... " do required action for CREATE
WHEN ... .
WHEN others.
ENDCASE.
The possible transaction types can be found at: im_trtyp -> data element -> <b>domain </b>(fixed values).
Regards
Uwe -
NavigateToURL where URLRequest method = POST always defaults to GET
Hi there
I'm trying to invoke a PHP URL using the HTTP POST method combined with parameters to pass to a form. The test app is an AIR application as per the code below. Whilst the default browser is launched with the URL specified, my issue is that the method used at runtime is always HTTP GET not POST. I'm not sure what I'm doing wrong. I'd be really grateful if somebody could review and point out my mistake!
Many thanks
Ed
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import flash.net.navigateToURL;
private function newWin(url:String):void {
var urlRequest:URLRequest = new URLRequest(url);
var variables:URLVariables = new URLVariables();
var rhArray:Array = new Array(new URLRequestHeader("Content-Type", "text/html"));
urlRequest.requestHeaders = rhArray;
variables.username = "admin";
variables.password = "admin";
variables.domain = "Default";
urlRequest.data = variables;
urlRequest.method = "POST";
navigateToURL(urlRequest);
private function buttonclick() : void
this.newWin("http://10.0.5.176/contactq/index.php");
]]>
</mx:Script>
<mx:Canvas id = "myCanvas" height="400" width="400">
<mx:Button id="myButton" click="buttonclick();" x="169" y="166" width="91" label="Invoke URL"/>
</mx:Canvas>
</mx:WindowedApplication>Firefox stores certificates that a server sends automatically in cert8.db for easier access, but that can also cause conflict if servers sends a certificate that is already stored.
-
Method POST no Allowed error. See my code, please.
What happend here?.
At submit the form I see the next error:
Method Not Allowed
The requested method POST is not allowed for the URL filesend.jsp.
Thanks.
**** filesend.jsp file ******
<%
if (request.getParameter("fichero")==null)
%>
<html>
<head>
<title>How send a file</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" enctype="multipart/form-data" method="post" action="filesend.jsp">
<input type="file" name="fichero">
<input type="submit">
</form>
</body>
</html>
<%
else
// Here the code for load the data after post submit
%>Your web server must be told that this kind of page (.jsp) can accept the POST method (default is GET only). It is not an error in the code. Talk to your server admin.
Maybe you are looking for
-
A few days after i've updated to iOS 8.1.1 my iphone 5s died and isn't turning on and its not charging. i have my legit charger that came with my phone and after 6 months it stopped working, i even have a charging case and that wont charge it. I goog
-
New line character in c:out
hi! I need to print a string in a table , and i am using <c:ForEach> and <c:out> tags to retrieve the data from a session scoped collection. the problem is that i need the data to be printed with new line characters to separate paragraphs, but if i p
-
Need information in understanding OBIA ETL Workflows
Hi All, I installed and configured OBIA on the OBIEE environment. I also got DAC installed and configured. When I opened the ETL workflows I seel almost eveyr workflow has a duplicate workflow name with suffix full. I don't know why this is being use
-
I spilled soup on my MacBook Pro, please help!?
I spilled soup on the keyboard, so I left my computer upside down and open to try to drain some of the liquid put. My computer turned itself off about a minute after the spill, and it won't turn back on, and I have.no idea why. I will leave my comput
-
Default selection parameter in ME2M
Is it possible to default selection parameter in ME2M to " ALL" by setting in SU3 - Parameter with parameter ID " SEL" If yes,what is the parameter value to be enter? Thank you