How to execute a jsp instruction from a java class?
How to execute a jsp instruction from a java class?
Any help please.
Thank's
I'll detail my problem:
Supposing that I have a jsp file called: start.jsp
In the start.jsp I instanciated an object called global from the class Global ( for example ).
Then, I called a custom taglib:
<ix:mytag/>
In the suitable tld file: the mytag is defined:
<tag>
<tag class>Tag1<.....
The java file Tag1 has method:
doStartTag(){
// here is the problem
global.doSomeFunctions();
Okay, the problem is that the object gobal is not defined in the class Tag1. what to do?
I think that I have to pass the object global as a parameter to the class Tag1. How to do that?
Actually, the problem was to insert the follwoing in the doStartTag method:
doStartTag(){
pageContext.getOut().print("<%= hello world %>");
The output is <%= hello world %> not hello world.
Okay, the new problem is how to pass an object as a parameter to a class called from a tld file.
Any help please.
Thank's too much
Similar Messages
-
Executing one system command from one java class. ERROR. Please help me
Hello i am trying to add users into one linux machine using one jaav program but when i execute the java class the system doesn't show me any error and dont make anything.
The linux command, in the main of the class, is correct; from thelinux shell it runs well, but from the java class it doesn't run.
Can you help me please?
thanks
import java.io.*;
public class ejecutaUsuario {
/** Creates a new instance of ejecutaUsuario */
public ejecutaUsuario(String cmdline) {
try {
String line;
Process p = Runtime.getRuntime().exec(cmdline);
BufferedReader input =
new BufferedReader
(new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null) {
System.out.println(line);
input.close();
catch (Exception err) {
err.printStackTrace();
System.out.println(err);
public static void main(String argv[]) {
String passwd="hola";
String usuarioInterno="xxxxxx";
new ejecutaUsuario("/bin/sh useradd -p `openssl passwd -1 -salt 12345678 " + passwd + "` -d /home/" + usuarioInterno + " -m -s /bin/bash " + usuarioInterno);Try gettting the error input stream as well (getErrorStream()). Maybe you are getting output there.
You might want to try just executing the 'useradd' part, getting the output stream of that process, and then put the parameters of useradd into the outputstream.
Later
Cardwell -
How to Run a .sql file from simple java class
How to execute a .sql file consisting of Complex Queries,procedures through simple java class.
The queries may have different delimiters,queries independant of each other.
I am able to do with Specific De-limiter.But I need in such a way that there should not be any
Constraints. Since My .sql may Contain different De-limiters.
If any one can Suggest Some Solution.
It will be Great Help.
regards
AnilCheck out ibatis script runner, it' a third party library but quite handy for running sql files...
m -
How to launch a new JVM from a java class?
I want to update a runing java applicaton. Before updating it, I have to shut down this application and open a new JVM (launch another java class with main method inside another JVM). Then update this application. After updating, restart this application. How to do it?? Thanks. Gary
Hi!
I'm using an applet to upload a library in the ext directory and then opening another applet that uses that library...
If I manually upload the library the second applet works
but if I try to load it at runtime with the first applet the file is saved correctly but the second applet doesn,t work :((
the second applet works only if I close the browser and open it again...:((
I need to reaload the JVM at runtime or maybe opening a new one...
can anyone help me?
please reply me if you found anything similar,
ciao!
fabibu -
How to make an exe file from a java class file
i know one of the java's most powerfull properties is plataform independent, but if i have done one application (with GUI) that i want to run on Win32 for example, if anyone knows how to make it please send me a message to [email protected], how i know that can be make it? because HotJava is made in Java and in Win32 is a executable
Do a search on these forums for any of the thousands of times this question has been asked and any of the thousands of times it's been answered.
-
How to open a JSP page from a form ??? plz help
hi ..
i want to know how to open a jsp page from a oracle apps form using a button .
the requirement is that whenever we click on the button created on the form, it opens a jsp page.
plz help me ..its urgent !! :-(In portlet project, to navigate between pages, you should not use the URL property to link to a page. Instead, portlets use navigation via action handling. You use the Page Navigation editor to set up links to pages; that is, the navigation editor sets the action property.
Here is an example to hyperlink ans button to open a new page:
# From within the IDE, create a new portlet project. This action creates the project and one page, PortletPage1.jsp.
# Create a second portlet page, called PortletPage2.jsp, for the project.
# Drop a Hyperlink component onto the first portlet page, PortletPage1. (You can drop the Hyperlink on the page in the Design window or on the PortletPage1 node in the Outline window.) Change the Hyperlink's text property to Next Page.
# Drop a Button component (found in the Basic section of the Palette) onto the second portlet page, PortletPage2.
# Open the Page Navigation Editor. It displays the two pages (PortletPage1.jsp and PortletPage2.jsp) of the application.
# Click the PortletPage1.jsp icon in the Navigation window to expand it, and then drag a connector from hyperlink1 to PortletPage2.jsp. Change the name of the connector from case1 to Page2.
# Click the PortletPage2.jsp icon in the Navigation window to expand it, and then drag a connector from button1 to PortletPage1.jsp. Change the name of the connector from case1 to Page1.
# Run and deploy the portlet. The browser displays PortletPage1 and you should see the Next Page hyperlink. When you click the Next Page hyperlink, the Apache Pluto Portal server displays PortletPage2. Click the Page2 button to return to PortletPage1.
Sherry
Creator Team -
How to invoke a jsp page from java which does not use Servlets?
Hello,
I am working in Documentum. I am trying to invoke a jsp page from another java page which does not use Servlets.
I tried doing this by just instantiating the java class related to the jsp page from my present java class.In my java class related to the jsp page, I have defined onInit() and onRender() methods.
Now, I am trying to call the jsp page from my present java class by just instantiating the java class related to the jsp page. This throws a java.lang.NullPointerException.
Any comments or suggestions on this.Any help would be appreciated.
Thanks,
Ranjith M.VRanjithM.V wrote:
Hello,
Thanks for the reply. One important thing I forgot to mention. I am also using xml component.And?
As this is the standard way used for coding in Documentum, I do not want to use Beans.Well, JSP's should, in and of themselves, contain no functional code. It should all be only display.
Without that is it not possible?What did I say? I said,
masijade wrote:
It is possible, but I very, very, very, much doubt, that it would be worth the effort.And, if you don't know how, a forum is not truely going to be able to help you implement it (at least not in less than a few years time, at which point it would be outdated).
>
Appreciate your understanding and help.
Thanks,
Ranjith M.V -
How to call a jsp page from oaf and run in jDeveloper
Hi all,
I created sample jsp and then tried.
String temp = "sample.jsp?";
pageContext.setForwardURL(temp,
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
It worked.
But when i tried with one of the custom page that i downloaded from server it is giving error.
But now i need to call that page.
Its Code is given on below link:
Re: how to call a jsp page from oaf
Please help me to do this.
Thanks in advance.
Regards,
RajRaj,
1. Hope you have placed the custom jsp page (which you have downloaded from server) under "jdevhome\jdev\myhtml\OA_HTML" directory ?
2. Try to run the custom jsp page from Jdeveloper directly and check whether its working properly or not ?
(i.e. add jsp page to any project in Jdeveloper then right click on jsp page and select Run xxx.jsp)
3. If page errors out then custom jsp page seems require few parameters to run it successfully. Pass all requied parameters and test.
4. There is no problem in the way you are calling jsp page from OAF page.
regards,
Anand -
How to call a JSP page from Applications menu?
Hi partners,
I am still looking for "how to call a JSP page from Applications menu?", I mean instead of calling a form, I want to call a JSP page which is staying in a OC4J repository which is located in another server.
Any idea will be really appreciated.
Thanks in advance.
Frank Mtz.Hi Frank,
if u know the solution please share it with me. i'm looking for the same scenario.
thanks in advance,
anish -
How to call a .jsp file from Applet
Could any one guide me how to call a .jsp file from a Applet using action Event.
Thankshttp://javaalmanac.com/cgi-bin/search/find.pl?words=URL+post
-
How to execute unix command line from cocoa?
how to execute unix command line from cocoa?
for example, if I want to call "ping" from cocoa, how should I do it? and how can I obtain the return value?
thank you.
Power G5 Quad Mac OS X (10.4.3)The following article may also help:
http://cocoadevcentral.com/articles/000025.php
Mihalis.
Dual G5 @ 2GHz Mac OS X (10.4.6) -
How to execute a .sql file from a batch file
Hi all
I've to take backup of a database weekly twice on every wednesday & Friday @ 5pm IST. I've written a hot backup script, which works every well.
now i want to automate the script. ie i want this script to run on wednesday & friday @ 5pm without any human interfearance ie with out actually any1 executing this script.
i created a batch file prod.bak with the following lines
@echo off
set oracle_sid=testdb
set oracle_home=d:\oracle\ora92
sqlplus /nolog
connect sys as sysdba/oracletest@testdb
this batch file when eexecuted connects me to sql prompt.
Now i want to execute my backup script bkp.sql automatically when it is connected to sql prompt.
(i tried with these lines in the above batch file...
call bkp.sql---it just opens the bkp.sql file in notepad & displays the script
start bkp.sql---same as call
connect / as sysdba/pwd@[email protected] --- does not work simply remains a the sql prompt.
At 17:00 /Every:w,f "d:\bkp.sql"---does not work simply remains at the sql promt.)
Can any1 let me know what should i write in the batch file that will execute the bkp.sql file automatically after it gets connected to sql prompt. M using oracle 9i.
I'll manage he time through windows utility of scheduling task.. Let me know how to execute the .sql file from a batch file.
Thanks
TriptiTry
sqlplus "sys/oracletest as sysdba" @bpk.sql
Working locally, and having set the ORACLE_SID, you don't need to specify the SqlNet alias (@testdb).
Remember to put an exit at the end of the bpk.sql script. -
How to execute SQOOP.cmd file from SSIS execute process task?
How to execute SQOOP.cmd file from SSIS execute process task?
What is argument need to be prefixed in the arguments property
Executable: C:\Hadoop\sqoop-1.4.2\bin\sqoop.cmd
Arguments: /C "sqoop import -connect "jdbc:sqlserver://mysystem:1433;database=test;username=myuser;password=mypwd;" -table emp -target-dir /user/emptable -m 1"
Thanks
DurgaHi Durga,
SQOOP.cmd must be no different than any other .cmd/.bat I assume, your question is more about setting the parameters up I guessed.
So unless the arguments change dynamically you can call SQOOP.cmd from yet another .cmd that has its parameters passed to it and the former you simply set to run without the arguments in Execute Process Task.
Otherwise, in general to set a bat/cmd file to run in SSIS one needs to do this:
PS: It is a good idea to populate the working directory with the path to the .cmd
Arthur My Blog -
How can I access JSP variables from a JavaScript function in a JSP page?
Respected sir
How can I access JSP variables from a JavaScript function in a JSP page?
ThanxYou may be get some help from the code below.
<%
String str="str";
%>
<script>
function accessVar(){
var varStr='<%=str%>';
alert(varStr);// here will diplay 'str'
</script> -
How to execute 2 different application from same Application Server
Hi,
I would like to know that how to execute two different applications from the same Application Server with different databases?
We are using
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
Oracle Application Server 10g 10.1.2.0.2
Regards,
Hassanwhat type of applications you want to run from the same application server, Hassan?
What other DB are you using to launch it beside the one you quoted? Is it the MRep DB of infra?
Maybe you are looking for
-
ASKB error - Posting period 012 2009 is not open
Hi All, We are using ECC 6.0 version. We have posted an asset acquisition on 31st Dec 2008 in a Local Dep area with posting date 31st Dec 2009. Posting was made only in Local ledger and not in leading ledger. It was a mistake from our side and rectif
-
when i send a text in iMessage the person receiving it gets it from my email address... how do i change that. and in message settings the receiving thing has my email and phone number but my phone number is gray and i can't click on it help
-
ITunes STILL won't open on Windows...help please?
So, I am pretty frustrated. I downloaded the lastest version of iTunes 7.2 a few days ago, and after installing it, I kept getting Symptom B as mentioned in the announcement above, "If iTunes 7.2 won't open or stay open on Windows..." posted by Roy B
-
Will my Photoshop CS3 V. 10.0 work with Mountain Lion please?
Will my Photoshop CS3 V. 10.0 work with Mountain Lion please? Thanks.
-
Which online tutorial do you recommend to learn FCPX 10.1?
There is an olverwhelming amount of websites and YouTube tutorials to learn FCPX 10.1. Which YouTube channel or website do you recommend? I am currently thinking about www.rippletraining.com. Thank you in advance. I also wanted to add that I learn be