Need to run RemoteDesktop from JSP file, WebServer Running in Linux.
Hi All,
i want to run a RemoteDesktop(.RDP) from a JSP page, webserver is running on Linux.
Like i am having abc.rdp file, when i am invoking this file from the jsp, it is displaying the content of the abc.rdp file.
instead of that i am using MIME, following is the snippet i am using.....
String filepath=path+objId+".rdp";
FileInputStream fis = new FileInputStream(filepath);
System.out.println(" filepath "+filepath);
byte[] bytes = new byte[fis.available()];
response.setContentLength(bytes.length);
fis.read(bytes,0,bytes.length);
javax.servlet.ServletOutputStream Pout = response.getOutputStream();
//String string = new String(bytes);
//Pout.println(string);
Pout.println(bytes);
Pout.flush();
Pout.close();
fis.close();
the above code is asking me to save the .rdp file. But i want to run the .rdp file directly without asking me saving option.
Your Views and Suggestions are valuble to me....
Thanks
Chiranjeevi.
you need to configure the web browser to associate that particular file type with the appropriate action
Similar Messages
-
How to run .ksh file in unix from .jsp files
Hi frnd,
How to connect unix servers from .jsp file & I want to run unix scripts .ksh files from .jsp files
Thanku
bhupathipawanIt is usually a bad idea to do any major processing directly within a JSP. It is better to create a helper class and invoke methods on that. This helper class can then be tested outside of the inhospitable JSP environment.
To run the '.ksh' file you will need to use either Runtime.exec() or the more modern ProcessBuilder. You will save yourself a lot of grief if you read thoroughly the 4 sections of http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html and then implement the recommendations.
Note - although the 'traps' article is written around the use of Runtime.exec(), it's content is equally applicable to ProcessBuilder. -
Need to Send Mail from JSP...
Dear Team,
I Need to Send Mail from JSP, have Designed user Interface to enter
to, from, subject, and message text .
Have Downloaded mail.jar and activate.jar file..... and placed in tomcat lib directory and WEBAPPS/WEB-INF/lib Directory too
How do i send a mail to user ?
do I require something else apart from things that i have mentioned?
do i have to Configure SMTP, POP3 or Something like this....
Now If I Create a object of Type MimeMessage and Set Recipient, from, subject and if i say transport.send(message) will this do My JOB???Dear Team,
I Need to Send Mail from JSP, have Designed user
Interface to enter
to, from, subject, and message text .
Have Downloaded mail.jar and activate.jar file.....
and placed in tomcat lib directory and
d WEBAPPS/WEB-INF/lib Directory too
How do i send a mail to user ?
do I require something else apart from things that i
have mentioned?
do i have to Configure SMTP, POP3 or Something like
this....
Now If I Create a object of Type MimeMessage and Set
Recipient, from, subject and if i say
transport.send(message) will this do My JOB???Yup! in addition to all the above i need to know my mail box outgoing mail server. and that's enough...... i am able to do that.
Regards,
Jagadeesh HS. -
Problem with accessing init parameters from JSP file
Hi,
I have my init parameters and Jsp configured in web.xml
<servlet>
<servlet-name>TestJsp</servlet-name>
<jsp-file>/Test.jsp</jsp-file>
<init-param>
<param-name>username</param-name>
<param-value>Balboa</param-value>
</init-param>
</servlet> How do I access 'username' field from JSP file.
Kindly help.
Thanks.you can do this in the jsp
<%=config.getInitParameter("username")%>or do it in the jspInit method in the jsp:
<%! String userName = null;
public void jspInit() {
ServletConfig config = getServletConfig();
userName = config.getInitParameter("userName ");
%>
Hello <%=userName%> -
Hi
is it possible to call any method with in the class except handle method from jsp file?You can call , but it would not be a good design approach.A droplet can do the same task for you.
otherwise :
eg :
<%@ page import="com.mypackage.MyClass"%>
for Static access :
<%
String test= MyClass.myMethod();
%>
for normal classes :
<%
MyClass object = new MyClass();
String test= object .myMethod();
%>
http://stackoverflow.com/questions/10918526/call-java-method-in-jsp-file
http://www.javaworld.com/javaworld/jw-05-2003/jw-0523-calltag.html?page=2
```
Praveer
Edited by: Praveer Rai on Mar 26, 2013 5:08 PM -
How run the simple .jsp file on 9 i as application server?
hi,
i developed simple .jsp file on notepad,the same .jsp file to run in 9ias server?
how can any one help me or send steps how to do?
jpullareddyHi,
Try out these samples...
http://otn.oracle.com/sample_code/tech/java/jsp/htdocs/jspdemo/OjspReadme.html
Thanks,
Rajat -
Calling oracle reports from jsp file
how to pass parameters from jsp file oracle reports.i am getting reports wihtout passin parameters.
pls help me
urgent
vasavadattaKarthik,
You might want to repost this question to the reports forum - you'll be more likely to get a response from a reports expert.
Thanks
Blaise -
Get JSP file to run with an applet tag under JDeveloper
I Created an applet and an html file under JDeveloper. with the applet tag in the html file.
when I run the html file the applet runs perfectly.
I Created a jsp file in the same project with the applet and the html file under JDeveloper. I copied and pasted the applet tag from the html file to the jsp file.
When I try to run the jsp file under JDeveloper I get
java.io.FileNotFoundExceptions for all of the jar files in the Applet tag ARCHIVE and for the applet tag CODE
This is the applet tag that I copied and pasted from the html file to the jsp file
BEGIN:
<APPLET CODE="myapplet.Applet1" ARCHIVE="jdev-rt.jar,ojsp.jar,ojsputil.jar,oc4j.jar,servlet.jar,ojc.jar" HEIGHT="200" WIDTH="200" ALIGN="bottom">This browser does not appear to support Applets.</APPLET>
END:
Here three example of the exceptions that I got BEGIN:
1.
java.io.FileNotFoundException: http://139.169.225.224:8988/JspToAppletWS-JspAppletInstantiation-context-root/jdev-rt.jar
2.
java.io.FileNotFoundException: http://139.169.225.224:8988/JspToAppletWS-JspAppletInstantiation-context-root/jdev-rt.jar
3.
java.lang.ClassNotFoundException: myapplet.Applet1
Here three example of the exceptions that I got END:
This is the html file that works BEGIN:
<HTML>
<HEAD>
<TITLE>
Title
</TITLE>
</HEAD>
<BODY>
<H2>
This is sample HTML text.
</H2>
<BR>
<APPLET CODE="myapplet.Applet1" ARCHIVE="jdev-rt.jar,ojsp.jar,ojsputil.jar,oc4j.jar,servlet.jar,ojc.jar" HEIGHT="200" WIDTH="200" ALIGN="bottom">This browser does not appear to support Applets.</APPLET>
</BODY>
</HTML>
This is the html file that works END:
This is the JSP file that does not work BEGIN:
<!--%@ page contentType="text/html;charset=windows-1252"%-->
<%@ page import = "myapplet.Applet1, java.util.Enumeration, java.util.Vector, javax.swing.JFrame, java.lang.*" contentType="text/html;charset=windows-1252"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>
Hello World
</title>
</head>
<body>
<h2>
The current time is:
</h2>
<p>
<%= new java.util.Date() %></p>
<APPLET CODE="myapplet.Applet1" ARCHIVE="jdev-rt.jar,ojsp.jar,ojsputil.jar,oc4j.jar,servlet.jar,ojc.jar" HEIGHT="200" WIDTH="200" ALIGN="bottom">This browser does not appear to support Applets.</APPLET-->
</body>
</html>
This is the JSP file that does not work END:
I would like to know what I need to do so that I can run
the Jsp file under JDeveloper with the applet tag without any exceptions.Hi,
I meet the same problem and can not get a solution from this forum or other forum in internet, either.
Have you already solved this problem? Can you tell me your solution? thanks in advance.
Regards -
Import From CSV File statement runs forever, no error, does not finish
Hello,
I am trying to import a CSV file in a JAVA program, with the following statement:
IMPORT FROM CSV FILE '/debug/testdatabase/FILE.csv'
INTO "JOSEPH"."TEST_TABLE"
WITH COLUMN LIST IN FIRST ROW
RECORD DELIMITED BY '\n'
FIELD DELIMITED BY '\t' ERROR LOG '/debug/testdatabase/file.err'
THREADS 10
BATCH 10000
I have two HANA instances on different machines A and B:
Both machines run HANA version 1.00.74.00.389160 (NewDB100_REL), while the OS is
SUSE Linux Enterprise Server 11.1 on machine A and
SUSE Linux Enterprise Server 11.2 on machine B.
The statement above runs fine on machine A and the rows are imported properly from JAVA as well as when executed from HANA Studio SQL console.
If I copy the file to machine B and try the exact same statement with the same file, it does not finish (neither from JAVA nor from HANA Studio SQL console). There is no error either. It cannot be cancelled, only a HANA restart stops the statement. Also the sample file I use has only 2 rows, and memory does not seem to be a problem.
I seem to have a similar problem to the one described here, but the answers there do not help me: http://scn.sap.com/thread/3396582 I specified the record delimiter, and I used a python script to check for any strange characters that are not supposed to be there, but didn't find any.
If I copy the file to my windows PC and use the "File Menu -> Import -> SAP Hana Content -> Data from Local file" function, it imports the file correctly into B, but I need to be able to do it from JAVA.
Machine A administration view:
Machine B administration view:
If you have any idea what might cause this behavior or where I can find more information on this problem please give me a hint.Hi Joseph,
First from the pics, the revision of your SAP HANA instance is 73 instead of 74. Since I have no identical environment, I cannot test it for you. But can you try the simplest scenario? You can create a table with only one column table try to import a CSV file with only one row.
Best regards,
Wenjun -
I want to send a value from JSP file to another JSP file without..
I want to send a value from one.JSP file to another two.JSP file without to show the content HTML of the one.JSP in two.JSP (with include), only take the values processed in a Bean :
===================
Bean
package pck;
import java.io.*;
public class yyyy {
public String getXxx() {
return cccc;
========================
one.JSP
<jsp:useBean id="idBean" class="pck.yyyy" scope="??"/>
<%idBean.setXxx(ccc);%>
========================
two.JSP
<%@ include file="one.jsp"%>
<%=idBean.getXxx()%>
but without to show the content HTML of one.JSP in two.JSP.
Can someone help me?, please.Why don't just put the common code in a separate file and include it in both. i.e. the code that is in one.jsp that is needed by two.jsp could be put in a common file and included in both pages, thus the HTML is separated off. If this will not work, set a boolean value in two.jsp that can be used by one.jsp to decide if the HTML should be displayed or not.
Steve -
Problem for ResourceBundle calling from jsp file
Hi, I am using WebLogic 5.1 in Solaris 8
I use java.util.resourceBundle to get the information from a .properties
file
I put the properties file in /opt/weblogic/myserver/serverclasses
When I call the properties file from EJB, It seems to be OK
But when I call the properties file from JSP using the same script, It said
the properties files not found
The Error message is:
<ServletContext-General> Servlet fail
ed with Exception
java.util.MissingResourceException: Can't find bundle for base name
test.dbini,
locale zh_TW
at
java.util.ResourceBundle.throwMissingResourceException(ResourceBundle
.java:707)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:679)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:546)
at
jsp_servlet._test._global_95_variable._jspService(_global_95_variable
.java:85)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:105)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:123)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:742)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
textImpl.java:686)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
ContextManager.java:247)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
a:361)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
PLease Help!!
Regards,
Fannie
Hi,
open dataset file for input in text mode.
check sy-subrc = 0.
while sy-subrc = 0.
read dataset file into wa.
if sy-subrc = 0.
append wa to itab.
else.
exit.
endif.
endwhile.
close dataset file.
regards
Siggi
PS: check also the F1-help for open, read and close statements! -
Segregating business Logic from JSP files.
I have an application with around 150 jsp files, out of which almost half of them are containing business logic.
I am actually in a process of segregating the java code from the jsp files.
Could you please guide me in finding out the best practices, dos and don'ts while engaging in such a process.
Thanks in AdvanceI've been through this hellish experience. I’m not sure any “best practices” for this exist.
gimbal2 idea of starting a new project would be ideal, if costly. The other extreme is “it works”, don’t touch ‘em until you need to change the functionality then work out the cost/befit of a rewrite for that slice.
If you really want to take this route:
How bad is the code that does not live in the JSPs? Should it be reused or avoided?
What level of functional test coverage do you have?
The approach my team and I took was to cut it down into slices and try to rewrite that slice as cleanly as possible. Where interactions between slices exist try to write a facade which calls the legacy code but looks like how you would want the new code to look.
This did not work perfectly. The facades were rarely used well and we had to drop major slices of work to complete on time leaving us with large chunks of legacy code that we can’t delete.
We started with no automated functional tests, but a goal of getting to a decent amount. We failed on this, which caused major issues - mop up lasted a month and a half after release. Drop functional slices to ensure that you end up with a solid set of automated tests. If you can not get your team to buy into this don't bother with the project. -
Help running a simple jsp file,Tomcat 5.0.16
Hi,
This question may be addressed many many times,but do reply.
I have a Win xp operating system
Installed Tomcat 5.0.16 in it.
Next the directory structure
PS : The sampleapp directory is outside the tomcat installation directory.
E:/sampleapp
| |
ROOT WEB-INF
|
classes
|
<package1><structure> .class files (for servlet works fine!!!!)
in the WEB-INF,there is the web.xml,then sourcefiles<dir> and the lib directory which is empty.
Now the servlet files work fine.........
I have placed my MyJsp.jsp file in the above mentioned ROOT directory.
I have not done any thing with the <TOMCAT_HOME>/conf/server.xml file
and the web.xml which I have written.
When I give the following URI
http://localhost:8080/sampleapp/MyJsp.jsp,
I get the HTTP status 404- /MyJsp.jsp
description: The requested resource (/MyJsp.jsp) is not available.
Hoping that I have defined the problem specifically.Kindly show some light on this.
Thanks
ASNevermind. I just found the answer. For the record, there are two ways in getting JSPs to work:
1. Precompiling the JSPs and modifying your webapp's web.xml file with the XML fragment generated in YourWebApp/web/WEB-INF/generated_web.xml;
2. Not precompiling the JSPs, but simply letting tomcat compile it on the fly on first access.
PRECOMPILATION METHOD
Go to http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jasper-howto.html. Copy-and-paste the ant script under the section "Web Application Compilation" into a file called compile.xml. For me, I save it in ~/development/compile.xml. Then compile the JSPs using the command (all in a single line):
$ANT_HOME/ant -file <PATH_TO_COMPILE.XML> -Dtomcat.home=<$TOMCAT_HOME> -Dwebapp.path=<$WEBAPP_PATH>
In my case, I cd into the directory where my app resides:
cd ~/development/HelloWorld
and then I type:
ant -file ~/development/compile.xml -Dtomcat.home=/var/tomcat5 -Dwebapp.path=.
(Note the trailing dot since my current directory is my webapp's directory itself. Also, in my case, my shell's PATH contains the path to the ant executable, so I just type 'ant' directly.)
Open the file ~/development/HelloWorld/web/WEB-INF/generated_web.xml and follow the instructions in that auto-generated file, which is: "Place this fragment in the web.xml before all icon, display-name, description, distributable, and context-param elements."
The web.xml referred to above is YOUR web.xml. In my case, it is the one in ~/development/HelloWorld/web/WEB-INF/web.xml
When ready to deploy, type:
ant dist
as usual. Deploy the .war file in the dist directory as you normally would. In my case, I do:
rm -rf $CATALINA_HOME/webapps/hello* (removes my HelloWorld webapp directory and its war file)
cp ~/development/HelloWorld/dist/hello.war $CATALINA_HOME/webapps
and wait for tomcat to unravel the war file. I can then access the JSP page based on whatever the generated_web.xml had specified. In my case, it would be http://localhost:8080/hello/sample.jsp
NON-PRECOMPILATION METHOD
Copy tools.jar from the Java JDK into tomcat's common/lib. (I found this only in the error message in tomcat's log file!! Didn't find it anywhere else!!). Do this one time only, then restart tomcat:
cp $JAVA_HOME/lib/tools.jar $CATALINA_HOME/common/lib
Restart tomcat.
Deploy your webapp as usual which will include your JSP files stored under your webapp's 'web' directory. No precompilation of JSPs is required. Then access your JSP pages such as http://localhost:8080/HelloWorld/my-jsp-page.jsp and tomcat will compile it on the fly on first access. The disadvantage is that there will be a slight delay on first access.
[Note: I am putting all this down for the record, because it took me MANY HOURS to figure all this out as the info on how to do this is not found clearly in one place!! Hope this helps others.]
My next step is to incorporate the contents of compile.xml as mentioned above, into my regular build.xml file. -
Problem Accessing Class in my package from jsp file
Hi,
I am using Apache tomcat server and i have made package which contains a class for database connection. I have imported this package in my jsp file but when i run the jsp tomcat gives the class not found exception. i have placed the jsp file in /webapps/my_project/ folder and the package in the /webapps/my_project/WEB-INF/classes/ folder.
Still its not working.
Please help me out!!!!!!!!hi,
Thanks for ur reply. You have guessed it right, i dont have a .jar file its a .class file in a package subfolder. I have tried out ur suggestion but it didnt work. The following error i shown when i run it.
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
C:\Apache Tomcat 4.0\work\localhost\_\College\test$jsp.java:4: Package college_lib not found in import.
import college_lib.*;
^
1 error, 1 warning
Here, College_lib is the package name which contains the class my class file
Is there any problem with my Apache Tomcat4.0 or any other thing.
Message was edited by:
Despo -
How to run/build the JSP file using Eclipse
Hello,
I want to build a new project for running the jsp file in eclipse.
Can you help me in doing that?
with some structure format?
where to create web.xml file
how to configure that fiel with our eclipse java poject?
like that...
Thanks,
SooryaOn New Project creation, choose 'Dynamic Web Project'. Then the structure will be created for you.
Maybe you are looking for
-
Code generation problem when inlining
I've run into an instance of incorrectly generated code. The problem appears to occur when a function is marked in the source with the "inline" or "__inline__" qualifiers but the compiler decides not to inline it. The problem only appears when there
-
Hello, I just bought a new Ipad Air 128gb w/verizon coverage. I definitely need a all proof case for it like the Lifeproof case I already have for my Ipad 4 w/retina display. Unfortunately I'm hearing Lifeproof hasnt come out with the Air case yet.
-
Ipad first gen crashing in safari
Any suggestions for iPad crashing...I have reset several times by clearing all data and resetting factory settings. Mostly happens in Facebook-on safari and sometimes the app, but also can crash on any site on safari, as well as any app. Just shuts d
-
Hi, I am getting the following error, detailed in the client.msi.log, when trying to install the SCCM 2012 SP1 client on windows 2008 R2 servers.Why StatusAgentProxy.dll fails to register. <![LOG[MSI: Action 22:08:03: RegisterTypeLibraries. Registeri
-
Hi, I have deleted all the requests from the ODS. Even though it is showing some data lying in the ODS tables (i.e ODS -> Manage -> Contents). Can anyone please advise how these records are lying in the tables and not get deleted when I deleted all t