How can we use java variable in javascript code on JSP page?
How can we use java variable in javascript code on JSP page?
Pls help
Think about it:
JSP/Java is executed on the Server and produces HTML+JavaScript.
Then that HTML+JavaScript is transfered to the client. The client now interpretes the HTML+JavaScript.
Obviously there's no way to access a Java variable directly from JavaScript.
What you can do, however, is write out some JavaScript that creates a JavaScript variable containing the value of your Java variable.
Similar Messages
-
How can I access xml document from javascript whithin a JSP page
how can I access xml document from javascript whithin a JSP page?
I have a JSP that receives an XML document from a JavaBean, so I can access it within the entire JSP, but I need to access it from the javascript inside the JSP... and I have no idea how i can do this.
Thanks in advance!The solution would only work on MS IE browsers, as other browsers do not support an XML DOM.
It can be done, but you would be stuck with using the Microsoft broswer. If that is acceptable, I have some example code, and a book recommendation. -
How can I use environment variables in a controller?
Hi all,
How can I use environment variables in a controller?
I want to pass a fully qualified directory and file name to FileInputStream and would like to do it by resolving an env variable, such as $APPLTMP.
Is there a method somewhere that would resolve this??
By the way,Did anyone used the class of "oracle.apps.fnd.cp.request.RemoteFile"?
The following is the code.
My EBS server is installed with 2 nodes(one for current,and other is for application and DB).I want to copy the current server's file to the application server's $APPLTMP directory. But the result of "mCtx.getEnvStore().getEnv("APPLTMP")" is current server's $APPLTMP directory.
Can anyone help me on this?
private String getURL()
throws IOException
File locC = null;
File remC = new File(mPath);
String lurl = null;
CpUtil lUtil = new CpUtil();
String exten;
Connection lConn = mCtx.getJDBCConnection();
ErrorStack lES = mCtx.getErrorStack();
LogFile lLF = mCtx.getLogFile();
String gwyuid = mCtx.getEnvStore().getEnv("GWYUID");
String tmpDir = mCtx.getEnvStore().getEnv("APPLTMP");
String twoTask = mCtx.getEnvStore().getEnv("TWO_TASK");
// create temp file
mLPath = lUtil.createTempFile("OF", exten, tmpDir);
lUtil.logTempFile(mLPath, mLNode, mCtx);
Thanks,
binghaoHowever within OAF on the application it doesn't.
what doesnt work, do you get errors or nothing ?XX_TOP is defined in adovars.env only. Anywhere else this has to go?
No, it is read from the adovars.env file only.Thanks
Tapash -
How can we use Session Variable in Answers or Analysis?
How can we use Session Variable in Answers or Analysis?
Again, duplicate cross-posting!
See rukbat 's post here: Re: BI Apps 7.9.6.3(Agent Issue) -
Dears,
I dont Understand How Can I Use the Variable Delay to Deploy Variable Delay on a Speedy-33 KitHello,
Thank you for posting to the NI Forums!! You should be able to incorporate the Variable Delay.vi into your vi and then build as normal and the functionality of the vi should translate to the build. What type of build are you doing? Are you receiving any specific errors? Thanks!
Regards,
Margaret Barrett
National Instruments
Applications Engineer
Digital Multimeters and LCR Meters -
How can i use substitution variable
Hai All
This is my sql statement
SELECT (TO_DATE(TO_CHAR(Intime,'DD-MON-YYYY')||' '||
TO_CHAR(0815,'0000'),'DD-MON-YYYY HH24:MI')-intime) * 24*60
from dail_att where to_char(intime,'hh24mi') between 0700 and 0815 ;
Here my table name called Dailyattendance
Intime field is declared as Date Type
So now i have hardcoded 0815 and now my intime is subtracted from this time so i can calculate the employee
coming late so how can i use substitution variable here to give the value at run time
Ie i need to give 0815 instead or any other time at runtime
Thanks In advance
Srikkanth.MWhere exactly are you planing to use it? Is sqlplus or at any other front end?
One way is to use below given SQL
SELECT ( TO_DATE ( TO_CHAR (intime, 'DD-MON-YYYY')
|| ' '
|| TO_CHAR (:TIME_VAR, '0000'),
'DD-MON-YYYY HH24:MI'
- intime
* 24
* 60
FROM dail_att
WHERE TO_CHAR (intime, 'hh24mi') BETWEEN 0700 AND 0815;*009*
Edited by: 009 on Apr 6, 2010 2:15 AM -
How Can I use a Variable in Data Controls query. Frank Kindly check...
Hii,
I am using JDeveloper 11g ADF BC.
My Requirement is that I hv a login screen which is taken from [http://blogs.oracle.com/shay/simpleJSFDBlogin.zip].
I hv attached BC in this application. I want to use the login usercode in the next pages after login screen. Next screen contains 3 list items which will be populating based on the user. So I created <af:selectOneChoice> using the BC( Just drag & dropped the column into the page from the data controls). But in the data control i want to use this usercode for passing the condition. Now Data is coming without any condition.
So How can I use the usercode in the Data controls query.
When I tried to display the usercode in the next page it is showing by binding the value. its code is follows
<af:outputText value="#{backing_getUser.uid}"
The program for checking the username & Password is follows.
package login.backing;
import oracle.adf.view.rich.component.rich.RichDocument;
import oracle.adf.view.rich.component.rich.RichForm;
import oracle.adf.view.rich.component.rich.input.RichInputText;
import oracle.adf.view.rich.component.rich.layout.RichPanelFormLayout;
import oracle.adf.view.rich.component.rich.nav.RichCommandButton;
import java.sql.*;
import java.util.List;
import java.util.Map;
import oracle.adf.view.rich.component.rich.output.RichMessage;
import oracle.jdbc.OracleDriver;
public class GetUser {
private RichInputText uid;
private RichInputText pid;
private RichCommandButton commandButton1;
private RichInputText inputText1;
private RichInputText inputText2;
public void setUid(RichInputText inputText1) {
this.uid = inputText1;
public void setPid(RichInputText inputText2) {
this.pid = inputText2;
public RichInputText getUid() {
return uid;
public RichInputText getPid() {
return pid;
public void setCommandButton1(RichCommandButton commandButton1) {
this.commandButton1 = commandButton1;
public RichCommandButton getCommandButton1() {
return commandButton1;
public String login_action() {
// Add event code here...
String user = this.getUid().getValue().toString();
// String pass = inputText2.getValue().toString();
String pid = this.getPid().getValue().toString();
Connection conn;
conn = getConnection();
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery ("SELECT usercode FROM guser where usercode = '"+user.toUpperCase()+"' and pwd=F_TEST('"+pid.toUpperCase()+"')");
if (rset.next()) {
conn.close();
return "good";
conn.close();
} catch (SQLException e) {
System.out.println(e);
return "bad";
public static Connection getConnection() throws SQLException {
String username = "ACCTS";
String password = "ACCTS";
String thinConn = "jdbc:oracle:thin:@SERVER1:1521:G5PS";
DriverManager.registerDriver(new OracleDriver());
Connection conn =
DriverManager.getConnection(thinConn, username, password);
conn.setAutoCommit(false);
return conn;
public void setInputText1(RichInputText inputText1) {
this.inputText1 = inputText1;
public RichInputText getInputText1() {
return inputText1;
public void setInputText2(RichInputText inputText2) {
this.inputText2 = inputText2;
public RichInputText getInputText2() {
return inputText2;
-----Hi,
I didn't look at the example, but if you want to secure your application then you should use container managed security. Read this .
Anyway, you could add this before return "good"; in your login_action()
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("username", user);Then, you can access this from anywhere in the application by using #{sessionScope.username}.
Pedja -
How can i use javabeans in forms?
You need to Create your JavaBean.
Then you need to run the "Oracle Forms PJC" Wizard which can be found at File | New .../Beans tab.
This wizard generates the correct adapters to allow JavaBean properties/events to be propogated to / from the Forms environment.
For more details, please search the Help system for PJC.
-John -
How can I get Java to fill out form on web page and submit?
I need to write a Java program that will submit a HTML form. I tried using POST already, but the only response I got back was the source code for the page itself. Looking more closely, I realized that there is a PHP script that will actually take the data from the forms and use it. How can I get Java to enter the data on the forms automatically and then run this PHP script? I don't need code, just a pointer in the right direction should do.
Thanks in advance,
Hasitha Dhasithad314 wrote:
I need to write a Java program that will submit a HTML form. I tried using POST already, but the only response I got back was the source code for the page itself. Looking more closely, I realized that there is a PHP script that will actually take the data from the forms and use it. How can I get Java to enter the data on the forms automatically and then run this PHP script? I don't need code, just a pointer in the right direction should do.
If you are writing a program to submit a form,how come the PHP script come out of nowhere ? At this momemnt you are just writing some Java program,isn;t it ?
My feeling is you are trying to edit some pre-written code.
Is it ?
Thanks. -
How can I use a pic from iPhoto as a background for a page, How can I use a pic as a background for a page
cd,
Insert the picture and position it as you desire
Make sure the picture is set to Floating in the Wrap Inspector
Arrange > Send Objects to Background
Regards, -
How can I use Java to do Seismic programming as Motif?
One of my friend recently finished a seismic on-site data processing program using
Motif on Solaries.He asked me if I can implement the same function to use Java language
so that the program can run on different platforms such as Windows,Unix.
Seismic data is usually enormous.And I don't have any experence in plotting seismic
curves by using Java.
Is there any seismic processing software programmed with Java available?
I will appriciate any help.
Thank youI think the point is not the word seismic than 'how to plot curves in Java.'.
You can find many resources about plotting curves you want in Java2D.
Refer to these URL:
Java2D http://java.sun.com/products/java-media/2D/index.html
Java2D Tutorial http://java.sun.com/docs/books/tutorial/2d/index.html -
How can I use local variable in LabVIEW-Action?
Hi All!
There is local variable (for example "MyVariable") in local scope of project. There is Action-step, created by LabVIEW. One of input terminals step is "Sequence Context".
How can I access to MyVariable by Sequence Context? Unbundle? It does't work.
Thank you.On the TestStand palette there is a VI called TestStand - Get Property Value.vi. Use that. Attached is an image showing how to use it. The trick is making it produce the correct data type. Do that by right clicking on the VI and selecting Select Type. Then you can choose the type. I think in LV 2010 and TS 2010 it is a polymorphic VI and you can just change it. I wrote an example here for Chaz: http://forums.ni.com/t5/NI-TestStand/How-to-execute-two-steps-in-parallel/td-p/1449874
It's the second example that's attached.
Hope this helps,
jigg
CTA, CLA
teststandhelp.com
~Will work for kudos and/or BBQ~
Attachments:
AccessLocalVar.JPG 67 KB -
How can I use java on the web?
hi
I would like to learn about making websites using java?? do i have to learn about javascript or another type of java??
Im new in using java applet, threading and stuff like that :).
And maybe I can make management systems in java language is this possible?
thanksmshadows wrote:
hi
I would like to learn about making websites using java?? do i have to learn about javascript or another type of java??
javascript is not a type of java. It is a separate language. What do you mean by "making websites". A website in its simplest form is just an HTML page. If you want to learn what's called a "server side web programming language", which will allow you to do things like retrieve data that a user entered into a form on an HTML page and store it in a database, then first you need to learn basic java, and then you need to learn basic HTML(and it would be beneficial to learn basic javascript although that's not mandatory), and then you need to learn "servlets+jsp"--which is the java version of a "server side web programming language". The easiest "server side web programming language" to learn and the one that is most popular is php.
Some books you might consider:
beginning Java: "Java2: A Beginner's Guide"
beginning servlets+jsp: "Murach's Java servlets and JSP(2008 edition)" -- includes an introduction to HTML
Im new in using java applet, threading and stuff like that :).OK. You don't need know applets or threading to learn servlets+jsp.
And maybe I can make management systems in java language is this possible?
Sure.
Edited by: 7stud on Jun 6, 2008 10:17 PM -
How can get & use java true type fonts in my applets
Hi
I could get the System fonts in my Applet by making use of Toolkit.getFontList()
I have used getGraphicsEnvironment to get fonts but my browser doesn't support it.I get ClassNotFoundException.
How can I get & make use True Type Fonts in my Java Applet.
any body knows reply immediate pls
Sivasimilar problem:
http://forum.java.sun.com/thread.jsp?forum=31&thread=164516
sorry, thats all i know.
tobias -
I want to use Java to develop DMI. Please help...Thanks.
You are not getting replies because your question may need a course to answer. Just like, hey, can someone tell me how to write an email application? Or,
Can someone show me how to build a house?
Start writing your application, when you get stucked, post your questions.
Or, at least be more specific. Like, elaborate DMI and things like that.
Do a search on DMI, you may find what you need.
Maybe you are looking for
-
Insert into and Invalid numeric constant
Hi all, i try create table t1 f1 fixed(10) and insert -2 into into t1: insert into t1(f1) values (-2) works fine insert into t1(f1) values (-(2)) does not work (Error Executing 'insert into t1(f1) values (-(2))' [-3016] (at 28): Invalid numeric cons
-
Trace a mapped_file in kernel dump back to a user/process
I am troubleshooting a paged pool consumption issue (MmSt and other tags related to ntfs.sys being top consumers) on a Windows2003 R2 SP2. I see from a kernel dump taken when server was unresponsive, using !memusage, around 80000 files listed as mapp
-
Migration, iPhoto and Aperture
I recently migrated my library from an emac running iPhoto 05 and using iPhoto Buddy to manage my libraries, to iPhoto 08. Wow, bit of a struggle but got there in the end. I only had 2 libraries running, work and home, which was a blessing. Now when
-
Patch application paused for patch
Hi All, The patch application paused while applying the 11.5.10 CU2 FAILED: file LoadDTDToClob.class on worker 1. FAILED: file LoadXSLTToClob.class on worker 2. FAILED: file LoadDTDToClob.class on worker 3. FAILED: file LoadDTDToClob.class on worker
-
Captivate 6, audio on slides randomly doesn't play
Hi, I am working in Captivate 6 adding closed captioning to files originally created in Captivate 5.5 by someone else. The audio will randomly not work on a slide or 2 in preview mode and when published (though it worked perfectly before from 5.5, bu