Create Form Beans from JSP/HTML forms
In the Builder certification objectives, there is one called "Create Form Beans from JSP/HTML forms". How can I do that? How can I create a form beam starting from the JSP form or HTML form?
Guys, no one from forum can answer this question?
Similar Messages
-
Create an XML document from a HTML form???
Good morning, is it possible to create an XML document from a HTML form
if yes, can someone tell me how to proceed exactely, I would be very thankful!Hi,
A very simple intro at this link. Apologies for anything unclear.
http://cswww.essex.ac.uk/TechnicalGroup/TechnicalHelp/xmlCreate.htm
best
kev -
MySQL: SELECT * FROM with a Variable from an HTML form
Hello,
I would like to insert the variable "find" from the HTML form below in the MySQL "SELECT * FROM" query beneath it. In other words, where the word "santafe" appears below, I would like to insert the variable "$find." But I can't quite get it to work. How do I do it?
Thanks in advance,
John
<form action="tsearch11.php" method="post">
<label>Enter Topic:
<input type="text" name="find" size="55"/>
<input type="hidden" name="searching" value="yes" />
<input type="submit" name="search" value="Search" />
</label>
</form>
Then, on tsearch11.php:
<?
mysql_connect("mysqlv3", "username", "password") or die(mysql_error());
mysql_select_db("sand2") or die(mysql_error());
$find = strip_tags($find);
$find = trim ($find);
$t = "SELECT * FROM santafe";
$y = mysql_query($t);
?>Putting a form variable in a SQL query to look for table or column names requires an extra level of security. You need to create an array of the valid names, and check that the form variable is in that array.
$find = get_magic_quotes_gpc() ? stripslashes($_POST['find']) : $_POST['find'];
$find = mysql_real_escape_string(trim($find));
// create an array of valid table names
$tables = array('santafe', 'sanfernando', 'guadalupe');
// check that the variable is in the permitted array
if (in_array($find, $tables)) {
$t = "SELECT * FROM $find";
$y = mysql_query($t);
} else {
$error = 'Sorry, you selected an invalid table.';
In the page itself, check whether $y exists before using it. Otherwise display the error:
if (isset($y)) {
// display the results
} elseif (isset($error)) {
echo $error; -
Generating XSD files from an HTML form......
What is the best way to generate XML Schema files from an HTML form? Are there any APIs, Frameworks, software products, that already do this for you? What is the best way to do this programmatically?
I was thinking about using DOM...
Any help and/or advice will be greatly appreciated...
With thanks,
Unnsse Khanusers select what they want in their schemas
If the Schema info is added in a JSP.
Element Name: elementA
Data Type: string
Sub-Elements(Sequence): elementB, elementC
The field values may be retreived with with the getParameter method.
String elementName=request.getParameter("ElementName");
String type=request.getParameter("DataType");
From the values retreived a Schema may be constructed with the org.w3c.dom.* classes. -
All
I trying to make a call to a doPost method of a servlet from the doGet method of the same servlet.
The call is made from an HTML form, so
*<form name="input" action="servlet/deleteAlertPage" method="post">*
======================================================================
The web.xml file entry is as follows:
*<servlet>*
*<servlet-name>deleteAlertPage</servlet-name>*
*<servlet-class>bsp.perceptive.custom.webapp.deleteAlert.deleteAlertPage</servlet-class>*
*<load-on-startup>0</load-on-startup>*
*</servlet>*
*<servlet-mapping>*
*<servlet-name>deleteAlertPage</servlet-name>*
*<url-pattern>/deleteAlertPage</url-pattern>*
*</servlet-mapping>*
So when I run my Servlet from my JDeveloper, I do see the “doGet” method getting executed successfully and I see my HTML from appearing on a browser page.
As soon as I press the submit button, where I want the “doPost” method to get executed, I get the following error:
Error 404--Not Found
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
*10.4.5 404 Not Found*
The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.
If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead.
The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource
is permanently unavailable and has no forwarding address.
Any ideas ? Is my Servlet Setup and Execution Correct ?
Any help is appreciated.
My JDeveloper Version is the latest release :
About
Oracle JDeveloper 11g Release 1 11.1.1.2.0
Studio Edition Version 11.1.1.2.0
Build JDEVADF_11.1.1.2.0_GENERIC_091029.2229.5536
Copyright © 1997, 2009 Oracle and/or its affiliates. All rights reserved.
IDE Version: 11.1.1.2.36.55.36
Product ID: oracle.jdeveloper
Product Version: 11.1.1.2.36.55.36
Any help and advice is greatly appreciated.
Regards
patriceJohn
I got it to work !!
I had to place the application name in the action value also I had to change the port number, from 8080 to be 7101.
However
It was not that straight forward, because when I created my web Application I gave it the application Name of "BSPCustPerWebApps" and Project Name of "BSPCustPerWebApps"and this is reflected in my JDeveloper folder structure: "....\mywork\BSPCustPerWebApps\BSPCustPerWebApps\src\bsp\perceptive\custom\webapp\deleteAlert"
now when I run my Servlet initially I noticed that Browser URL is saying : http://localhost:7101/BSPCustPerWebApps-BSPCustPerWebApps-context-root/deleteAlertPage
which means that the web application is : BSPCustPerWebApps-BSPCustPerWebApps-context-root
so I changed my action value to be
action="http://localhost:7101/BSPCustPerWebApps-BSPCustPerWebApps-context-root/deleteAlertPage"
and that worked.
Weblogic must have created/defauled the application name using the application name and project name that I gave duriung the servlet creation.
Is there a way of changing the application name to be something shorter and more meaningfull ?
Also I did not want to hard code the server name, port etc in the action value, so again is there way of making this to be derived ?
Do you know how to access the WebLogic Console ? , considering I have only installed JDev, which has an embedded weblogic server.
Thanks for your help. -
How to retrieve input data from a HTML form in the UTF-8 cha
I encountered the following problem with a JWeb Application:
I tried to write a JWeb-Application for OAS 4.0, that retrieves
input data from a HTML form and writes it into an Oracle
database.
All processing should be done in the UTF-8 character set.
The problem is, that the form data retrieved by getURLParameter
are always encoded in a non-unicode character set and I found no
way to change this.
Can anybody tell me what I should do to get the form data in the
UTF-8 character set?
nullHi
Try set in the JWEB application's Java environment such
SYSTEM_PROPERTY: file.encoding=UTF8.
Andrew
Thomas Gertkemper (guest) wrote:
: I encountered the following problem with a JWeb Application:
: I tried to write a JWeb-Application for OAS 4.0, that
retrieves
: input data from a HTML form and writes it into an Oracle
: database.
: All processing should be done in the UTF-8 character set.
: The problem is, that the form data retrieved by getURLParameter
: are always encoded in a non-unicode character set and I found
no
: way to change this.
: Can anybody tell me what I should do to get the form data in
the
: UTF-8 character set?
null -
Creating vecor art from a single form field.
How do I create vector art from a single form field within a pdf that has serveral form fields in it?
Thanks
ChrisI need to create vector art from text within one form field on a page with several form fields on it.
1- single form field
2- create vector art from text within the single form field mentioned above
3- if possible export to a file
4- if not possible how can I create vector art from a pdf automatically?
5- if possible, create a button that will allow users to create vector art from text in a single form field
Thank you,
Chris -
Can't create new pdfs from powerpoint; either form within Adobe or within powerpoint. I could do this yesterday and today it won't work for some reason. The error says "an unexpected error occurred. PDFMaker was unable to produce the Adobe PDF. How do I fix this?
Is there a log file in the document folder indicating what the problem was. There are a number of reasons that PDF creation may fail. You can try to print to the Adobe PDF printer to see if there is any indication in that process. The processing is different, but the same problems may show up with both processes.
-
I have a main fillable form. From this main form the user may need additional forms. I want to create checkboxes that link to these additional forms. This part I believe I know how to do (Properties/Actions/Open a File). What I want to add is a javascript to the checkbox that when the new file (or form) opens some of the data (the repetitive data like name, date, etc.) from the main form is placed into the form opened where the same form fields exist. Is this possible?
Yes, but then it all has to be done using a script. You can't use the built-in Open A File command.
-
Jsp/html form- servlet- xml parsing
does anyone have an example or know of a place where I can get code
which passes XML from jsp/html to servlet which parses the xml???
will be appreciated..........thanksHi,
Are u trying to acheive indpendent of browser solution or just want to know the things..
well,I have one idea ok.
Using JavaScript Constructs the XmL as u want, "let say
<root><name>Lokesh</name><age>25</age></root>" before submitting the page(I mean frm.submit()) assign to a hidden variable, since you have post kind of submit back at the servlet from the request object get the value and store it as String and using StringReader you just parse the XML
Just try the above one the below code
public org.w3c.dom.Document getXMLDocument() throws IllegalStateException,Exception
if (!containsXMLDocument())
throw new IllegalStateException("This request does not contain an XMLDocument");
javax.xml.parsers.DocumentBuilderFactory dbf=javax.xml.parsers.DocumentBuilderFactory.newInstance();
javax.xml.parsers.DocumentBuilder db=dbf.newDocumentBuilder();
java.io.StringReader strRdr=new java.io.StringReader(_xmlString);
org.xml.sax.InputSource ipSrc=new org.xml.sax.InputSource(strRdr);
org.w3c.dom.Document doc=db.parse(ipSrc);
return doc;
best of luck..
With Regards
Lokesh T.C -
Need to create PAR files from JSP
Hi,
In my project we are creating portal archives from JSP iviews .
Using NWDS we can easily create par files by going to Enterprise Portal workspace .But in my project we are not using NWDS or any other JSP editor .
Can anybody tell me how to create par files if i am using only notepad to develop my JSP .
Thanks a lot .Hi
here is the link how to create a par file without using any editor
http://support.sas.com/rnd/itech/doc9/portal_dev/tasks/dg_portlet_parfile.html
all the best..
thanks Regards ,
Boopalan.M -
hi,
I tried to my best to call java beans from JSP page but it generate error that "unable to load class....", please help me that in which directory jsp file and bean *.class file reside, currently my setting are as follows.
Note: I am using tomcat server and my jsp and servlet files are running seccessfuly, there is any special change in classpath for java beans? if any please tell
My jsp file is in tomcat-->webapps-->jsp--><my file>
My bean (*.class) file-->webapps-->Root-->web-inf-->classes--><my file>
Pleae help me for the above problem.
Mubashar ([email protected])According to J2EE standards:
The web appl directory structure should be:
WebAppRootDirectory
|
|---html, jsp, images etc
|
|---WEB-INF---
|---classes--
|---lib
|
|
1) Make sure WEB-INF is in capital letters
2) Place all ur beans in classes dir or sub-directory in
classes
3) In Tomcat place WebAppRootDirectory in webapps
directory
[email protected] -
Very big problem with JSF about FORM and "id=" for HTML form's elements and
I have discovered a very big problem with JSF about FORM and "id=" for HTML form's elements and java instruction "request.getParameterNames()".
Suppose you have something like this, to render some datas form a Java Beans :
<h:dataTable value="#{TablesDb2Bean.myDataDb2ListSelection}" var="current" border="2" width="50%" cellpadding="2" cellspacing="2" style="text-align: center">
<h:column>
<f:facet name="header">
<h:outputText value="Name"/>
</f:facet>
<h:outputText id="nameTableDb2" value="#{current.db2_name_table}"/>
</h:column>
</h:dataTable>
Everything works fine...
Suppose you want to get the name/value pairs for id="nameTableDb2" and #{current.db2_name_table} to process them in a servlet. Here is the HTML generated :
<td><span <span class="attribute-name">id=<span class="attribute-value">"j_id_jsp_1715189495_22:0:nameTableDb2">my-table-db2-xxxxx</span></td>
You think you can use the java instructions :
Enumeration NamesParam = request.getParameterNames();
while (NomsParam.hasMoreElements()) {
String NameParam = (String) NamesParam.nextElement();
out.println("<h4>"++NameParam+ "+</h4>);
YOU ARE WRONG : request.getParameterNames() wants the syntax *name="nameTableDb2" but JSF must use id="nameTableDb2" for "<h:outputText"... So, you can't process datas in a FORM generated with JSF in a Servlet ! Perhaps I have made an error, but really, I wonder which ?
Edited by: ungars on Jul 18, 2010 12:43 AM
Edited by: ungars on Jul 18, 2010 12:45 AMWhile I certainly appreciate ejb's helpful responses, this thread shows up a difference in perspective between how I read the forum and how others do. Author ejb is correct in advising you to stay inside JSF for form processing if form processing is what you want to do.
However, I detect another aspect to this post which reminds me of something Marc Andreesen once said when he was trying to get Netscape off the ground: "there's no such thing as bad HTML."
In this case, I interpret ungar's request as a new feature request. Can I phrase it like this?
"Wouldn't it be nice if I could render my nice form with JSF but, in certain cases, when I REALLY know what I'm doing" just post out to a separate servlet? I know that in this case I'll be missing out on all the nice validation, conversion, l10n, i18n, ajax, portlet and other features provided by JSF".
If this is the case, because it really misses the point of JSF, we don't allow it, but we do have an issue filed for it
https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=127
If you can't wait for it to be fixed, you could decorate the FormRenderer to fix what you want.
I have an example in my JSF book that shows how to do this decoration. http://bit.ly/edburnsjsf2
Ed -
How to call java bean from jsp
hi
How to call a java bean from jsp page..
Is any other way to call javabean from jsp page apart from this sample code...
<jsp:useBean id="obj" class="com.devsphere.articles.calltag.TestBean"/>
thnx in advanceIf you also use servlets, you can attach beans to the request or session and use them directly in your JSP's. So if you do:
request.setAttribute("name", yourBean);and then forward to a JSP, you can reference the bean like:
${requestScope.name} -
How to call Java Beans from JSP (eg.put them in a WAR or package)
Can anyone explain to me what are the steps and ways to call java beans from JSP?
1st, put the javabean classes in the right place:
the web-inf/classes/your_bean.class directory of corresponding web application
2nd in your jsp page:
<jsp:useBean id="obj_var_name" class="your_bean"/>
<jsp:setProperty name="obj_var_name" property="smthg" value="smthg_calue"/>
Micheal
Maybe you are looking for
-
When I connect the 30 pin digital AV adapter to my iPad 2 I get the above error message. I tried reset/ power recycle etc. No joy!
-
HELLP!! NEED TO KNOW HOW TO USE TWO IPODS ON ONE COMP!ASAP
i have an ipod nano and an itunes account. Now my mom has a nano and we need to know if you can register them on the same account and how or any other tips for using two ipods on one comp! PLEASE HELP ASAP! ZACH
-
GPIB-ENET driver 1.10 no longer works under Windows 2000 service pack 2
I have used my GPIB-ENET adapters with Windows 2000. However, since I installed service pack 2, the GPIB driver 1.10 no longer works. It seems to install correctly and puts the GPIB icon in the Control Panel. After a reboot, however, the icon is gone
-
I transfered all my games from my iphone4s to my ipad, but the game progress is lost.... I signed on to game centre it shows all my scores and progress but when i try to play with the games, all my progress and scores disappears... can anyone help???
-
Script to automate stop/start listener on aix
Hello everyone, We have a database on oracle 8i on aix platform and we have a scheduled restart on the db everyday. But we have been facing problem with the db restart and it gets hanged. As a solution, i wanted to develop a shell script that will st