How to redirect the to the file outside the context from jsp
Hello Everybody,
I am trying to redirect using jsp to the file available physically in the server machine out side the application.
How can I do it..
Thanks
Saikrishna
Write a servlet which takes the file ID as parameter, reads the file from the disk and writes it to the outputstream of the response. Finally redirect to that servlet with the file ID as parameter.
You can find here an example of such a FileServlet: [http://balusc.blogspot.com/2007/07/fileservlet.html].
Similar Messages
-
How to pass the context from Portal to Database for fine grain access?
Hi,
I am developing an omniportlet and I need to pass on the context of the logged in user to the database so that when the user tries to access data in the omniportlet, he can see data relevant to him only. Does anyone know how to do that?
I have set up a light weight user scott and also has a schema in the database by the same name (scott)..
what I am trying is when the user logs in as scott in the portal site and runs an omniportlet, he should be dynamically be logged in to scott the schema so that the data visible to him can be restricted. Same should happen for other users as well.
Does anyone know in which table in the PORTAL schema is this connection information stored, so that I can override it using some API..?
Thanks,
AbhiI had tried sending the user_name in the sql and that works fine. but my requirement is that the user should login to his schema and only his schema directly and automatically.. such that even if an omniportlet is created using some default schema, when user logs in he can access only the schema meant for him..
e.g. While running the omniportlet when logged-in as user scott, he should be logged-in to scott schema in the database, so that the fine grain access can be enabled ..
Edited by: user6386347 on Mar 12, 2009 12:15 PM -
How to pass the value from JSP or HTML to Applet
Plz reply ....How can we pass the value from the JSP Page or from HTML page to Applet embedded in same page....
Hi,
<applet codebase = "."
archive = foo.jar"
code = "com.bar"
name = "bar"
id = "bar"
width = "<%=Request["width"] %>"
HEIGHT = "<%=Request["appHeight"] %>"
hspace = "0"
vspace = "0"
align = "middle"
alt = "Applet is Loading..."
>
<param name="LANGUAGE" value="<%=Request["lan"] %>">
<param name="LOGOUT_USER_URL" value="EndSession.asp">
<param name="DATA_READ_INTERVAL" value="10000">
<param name="REFRESH_INTERVAL" value="5000">
<param name="DEFAULT_FONT" value="Arial">
</applet>
pass values @ ur html or jsp page to Applet as parameters.
Refer above code. By using getParameter() method of Applet, u can take values inside applet. -
How To Pass the value from JSP to Applet
plz reply how can we pass the value from the JSP to Applet ...the applet is embedded in JSP page....
Hi,
<applet codebase = "."
archive = foo.jar"
code = "com.bar"
name = "bar"
id = "bar"
width = "<%=Request["width"] %>"
HEIGHT = "<%=Request["appHeight"] %>"
hspace = "0"
vspace = "0"
align = "middle"
alt = "Applet is Loading..."
>
<param name="LANGUAGE" value="<%=Request["lan"] %>">
<param name="LOGOUT_USER_URL" value="EndSession.asp">
<param name="DATA_READ_INTERVAL" value="10000">
<param name="REFRESH_INTERVAL" value="5000">
<param name="DEFAULT_FONT" value="Arial">
</applet>
pass values @ ur html or jsp page to Applet as parameters.
Refer above code. By using getParameter() method of Applet, u can take values inside applet. -
How to send the data from jsp page to excel ???
hi all,
i want to send the data from my jsp form to excel sheet. any one can help me ??Hope this sample code might help :
StringBuffer data = new StringBuffer();
OutputStream ostream = response.getOutputStream();
response.setContentType("application/vnd.ms-excel");
response.setHeader( "Content-Disposition",
"attachment; filename=sample.xls" );
ostream.write(data.toString().getBytes());
ostream.flush();
Try it out.
Swathi -
Re: how to redirect the output from studio to a file
the thing is i have large amount of output(crapy uni project), it's kind of hard to read them in IDE output window, and i am too lazy to use fwrite to a file. in terminal it's just "output > filename", but doesn't work in IDE. anyone knows?
The Arguments property will take a "> file".
This property can be set in several places.
In studio 10/11:
- Debug->LoadProgram
- Debug->LoadRecent->EditLoadCommandList
After you've loaded a program...
- Debug->DbxConfigure
In studio 12:
Project (ctx menu)->Properties->Running(Category) -
Help me to control the transactions from jsp to java bean
Please anyone can guide me how to control the transactions from jsp to java bean. I am using the Websphere studio 5.1 to develop the database application. I would like to know two method to handle the database. First, I would like to know how I can control the transactions from jsp by using java bean which is auto generated for SQL statement to connect to the database. Following code are jsp and java bean.....
// call java bean from jsp
for (i=0;i<10;i++)
addCourse.execute(yr,sem,stdid,course,sec);
I write this loop in jsp to call java bean..
here is java bean for AddCourse.java
package com.abac.preregist.courseoperation;
import java.sql.*;
import com.ibm.db.beans.*;
* This class sets the DBModify property values. It also provides
* methods that execute your SQL statement and return
* a DBModify reference.
* Generated: Sep 7, 2005 3:10:24 PM
public class AddCourse {
private DBModify modify;
* Constructor for a DBModify class.
public AddCourse() {
super();
initializer();
* Creates a DBModify instance and initializes its properties.
protected void initializer() {
modify = new DBModify();
try {
modify.setDataSourceName("jdbc/ABAC/PreRegist/PRERMIS");
modify.setCommand(
"INSERT INTO informix.javacourseouttemp " +
"( yr, sem, studentid, courseid, section ) " +
"VALUES ( :yr, :sem, :studentid, :courseid, :section )");
DBParameterMetaData parmMetaData = modify.getParameterMetaData();
parmMetaData.setParameter(
1,
"yr",
java.sql.DatabaseMetaData.procedureColumnIn,
java.sql.Types.SMALLINT,
Short.class);
parmMetaData.setParameter(
2,
"sem",
java.sql.DatabaseMetaData.procedureColumnIn,
java.sql.Types.SMALLINT,
Short.class);
parmMetaData.setParameter(
3,
"studentid",
java.sql.DatabaseMetaData.procedureColumnIn,
java.sql.Types.CHAR,
String.class);
parmMetaData.setParameter(
4,
"courseid",
java.sql.DatabaseMetaData.procedureColumnIn,
java.sql.Types.CHAR,
String.class);
parmMetaData.setParameter(
5,
"section",
java.sql.DatabaseMetaData.procedureColumnIn,
java.sql.Types.SMALLINT,
Short.class);
} catch (SQLException ex) {
ex.printStackTrace();
* Executes the SQL statement.
public void execute(
String userid,
String password,
Short yr,
Short sem,
String studentid,
String courseid,
Short section)
throws SQLException {
try {
modify.setUsername(userid);
modify.setPassword(password);
modify.setParameter("yr", yr);
modify.setParameter("sem", sem);
modify.setParameter("studentid", studentid);
modify.setParameter("courseid", courseid);
modify.setParameter("section", section);
modify.execute();
// Free resources of modify object.
finally {
modify.close();
public void execute(
Short yr,
Short sem,
String studentid,
String courseid,
Short section)
throws SQLException {
try {
//modify.setUsername(userid);
//modify.setPassword(password);
modify.setParameter("yr", yr);
modify.setParameter("sem", sem);
modify.setParameter("studentid", studentid);
modify.setParameter("courseid", courseid);
modify.setParameter("section", section);
modify.execute();
// Free resources of modify object.
finally {
modify.close();
* Returns a DBModify reference.
public DBModify getDBModify() {
return modify;
I would like to know that how can I do for autocommit from jsp. For example, the looping is 10 times which mean I will add 10 records to the db. If the last record is failed to add to db, "how can I rollback the perivious records?" or guide me to set the commit function to handle that case. Thanks a lot for take your time to read my question.Hello.
The best method is using a session bean and container managed transactions. Other method is using sessions bean and the user transaction object (JTA-JTS).
so, JDBC has transaction management too.
good luck. -
How to get the value from a JavaScript and send the same to Java file?
Hi.
How to get the value from a JavaScript (this JS is called when an action invoked) and send the value from the JS to a Java file?
Thanks and regards,
Leslie VYes, I am trying with web application.
In the below code, a variable 'message' carries the needed info. I would like to send this 'message' variable with the 'request'.
How to send this 'message' with and to the 'request'?
Thanks for the help :-)
The actual JS code is:
function productdeselection()
var i=0;
var j=0;
var deselectedproduct = new Array(5);
var message = "Are you sure to delete Product ";
mvi=document.forms[0].MVI;
mei=document.forms[0].MEI;
lpi=document.forms[0].LPI;
if(null != mvi)
++i;
if(null != mei )
++i;
if(null != lpi)
++i;
if(null != mvi && mvi.checked)
deselectedproduct[++j]="MVI?";
if(null != mei && mei.checked)
deselectedproduct[++j]="GAP?";
if(null != lpi && lpi.checked)
deselectedproduct[++j]="LPI?";
if( 0!=j)
if(i!=j)
for (x=0; x<deselectedproduct.length; x++)
if(null != deselectedproduct[x])
message =message+ "-" +deselectedproduct[x];
alert(message);
else
//alert(" You cannot remove all products!");
return false;
return true;
} -
How to read the data from Excel file and Store in XML file using java
Hi All,
I got a problem with Excel file.
My problem is how to read the data from Excel file and Store in XML file using java excel api.
For getting the data from Excel file what are all the steps i need to follow to get the correct result.
Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
Thanks & Regards,
Sreenu,
[email protected],
india,If you want someone to do your work, please have the courtesy to provide payment.
http://www.rentacoder.com -
How to Load the data from excel file(Extension is .CSV) into the temp.table
Hi
How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
Kindly Suggest the Solution.
Regards,
SachinHello Sachin,
You can use the following metalink note:How to Read Data from an EXCEL Spreadsheet into a Form Using Webutil Client_OLE2 (Doc ID 813535.1) and modify it a little bit.
Instead of copy values into forms you can save them in your temporary table.
Kind regards,
Alex
If someone's helpful or correct please mark it accordingly. -
How to load the data from .csv file to oracle table???
Hi,
I am using oracle 10g , plsql developer. Can anyone help me in how to load the data from .csv file to oracle table. The table is already created with the required columns. The .csv file is having about 10lakh records. Is it possible to load 10lakh records. can any one please tell me how to proceed.
Thanks in advance981145 wrote:
Can you tell more about sql * loader??? how to know that utility is available for me or not??? I am using oracle 10g database and plsql developer???SQL*Loader is part of the Oracle client. If you have a developer installation you should normally have it on your client.
the command is
sqlldrType it and see if you have it installed.
Have a look also at the FAQ link posted by Marwin.
There are plenty of examples also on the web.
Regards.
Al -
How to load the data from excel file into temprory table in Forms 11g?
Hi
How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
Kindly Suggest the Solution.
Regards,
SachinDeclare
v_full_filename varchar2(500);
v_server_path varchar2(2000);
v_separator VARCHAR2(1);
v_filename VARCHAR2(400);
filename VARCHAR2 (100);
v_stop_load varchar2 (2000);
v_rec_error_log varchar2(4000);
v_error_log varchar2(4000);
ctr NUMBER (12);
cols NUMBER (2);
btn number;
RES BOOLEAN;
application ole2.obj_type;
workbooks ole2.obj_type;
workbook ole2.obj_type;
worksheets ole2.obj_type;
worksheet ole2.obj_type;
cell ole2.obj_type;
cellType ole2.OBJ_TYPE;
args ole2.obj_type;
PROCEDURE olearg
IS
args ole2.obj_type;
BEGIN
args := ole2.create_arglist;
ole2.add_arg (args, ctr);
ole2.add_arg (args, cols);
cell := ole2.get_obj_property (worksheet, 'Cells', args);
ole2.destroy_arglist (args);
END;
BEGIN
v_full_filename := client_get_file_name(directory_name => null
,file_name => null
,file_filter => 'Excel files (*.xls)|*.xls|'
||'Excel files (*.xlsx)|*.xlsx|'
,message => 'Choose Excel file'
,dialog_type => null
,select_file => null
If v_full_filename is not null Then
v_separator := WEBUTIL_CLIENTINFO.Get_file_Separator ;
v_filename := v_separator||v_full_filename ;
:LOAD_FILE_NAME := substr(v_filename,instr(v_filename,v_separator,-1) + 1);
RES := Webutil_File_Transfer.Client_To_AS(v_full_filename,"server_path"||substr(v_filename,instr(v_filename,v_separator,-1) + 1));
--Begin load data from EXCEL
BEGIN
filename := v_server_path||substr(v_filename,instr(v_filename,v_separator,-1) + 1); -- to pick the file
application := ole2.create_obj ('Excel.Application');
ole2.set_property (application, 'Visible', 'false');
workbooks := ole2.get_obj_property (application, 'Workbooks');
args := ole2.create_arglist;
ole2.add_arg (args, filename); -- file path and name
workbook := ole2.get_obj_property(workbooks,'Open',args);
ole2.destroy_arglist (args);
args := ole2.create_arglist;
ole2.add_arg (args, 'Sheet1');
worksheet := ole2.get_obj_property (workbook, 'Worksheets', args);
ole2.destroy_arglist (args);
ctr := 2; --row number
cols := 1; -- column number
go_block('xxx');
FIRST_RECORD;
LOOP
--Column 1 VALUE --------------------------------------------------------------------
olearg;
v_stop_load := ole2.get_char_property (cell, 'Text'); --cell value of the argument
:item1 := v_stop_load;
cols := cols + 1;
--Column 2 VALUE --------------------------------------------------------------------
olearg;
:item2 := ole2.get_char_property (cell, 'Text'); --cell value of the argument
cols := cols + 1;
--<and so on>
ole2.invoke (application, 'Quit');
ole2.RELEASE_OBJ (cell);
ole2.RELEASE_OBJ (worksheet);
ole2.RELEASE_OBJ (worksheets);
ole2.RELEASE_OBJ (workbook);
ole2.RELEASE_OBJ (workbooks);
ole2.RELEASE_OBJ (application);
END;
--End load data from EXCELPlease mark it as answered if you helped. -
How to load the data from excel file into table in oracle using UTL_FI
How to load the data from excel file into table in oracle
and from table to excel file
using UTL_FILE package
Please give me some exampleThis is something i tried in oracle apex
http://avdeo.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
Regards,
CKLP -
Need how to get the data from the external file in eCatt
Hi ,
Could any body suggest how to get the values from the external file(Excel,CSV file,Text file) and pass it as varaiable in ecatt Test script.
Problem: Need to execute FK01-Vendor creation Transaction with multiple set of data .As per my understanding we could achive through Variants in Testdata set in eCatt .
But is there any way to store the data in excell file and get the data and pass it to FK01 Test scripts
Appreciate response on thisHi
See the links they may be useful
check these link,
eCATT- An Introduction
/people/sumeet.kaul/blog/2005/07/26/ecatt-an-introduction
Creating Test Scripts
/people/sumeet.kaul/blog/2005/08/10/ecatt-creating-test-scripts
eCATT Logs
/people/sapna.modi/blog/2006/04/18/ecatt-logs-part-vi
eCATT Scripts Creation TCD Mode
/people/sapna.modi/blog/2006/04/10/ecatt-scripts-creation-150-tcd-mode-part-ii
Creation of Test Data Container
/people/sumeet.kaul/blog/2005/08/24/ecatt-creation-of-test-data-container
eCATT Scripts Creation - SAPGUI Mode
/people/sapna.modi/blog/2006/04/10/ecatt-scripts-creation--sapgui-mode-part-iii
Integrating ECATT & MERCURY QTP Part -1
/people/community.user/blog/2007/01/02/integrating-ecatt-mercury-qtp-part-1
Using eCatt to Test Web Dynpro ABAP
/people/thomas.jung/blog/2006/03/21/using-ecatt-to-test-web-dynpro-abap
and
-command reference
http://help.sap.com/saphelp_nw04/helpdata/en/c6/3c333b40389c46e10000000a114084/content.htm
/people/sapna.modi/blog/2006/04/10/ecatt--an-introduction-part-i
http://prasadbabu.blogspot.com
https://www.sdn.sap.com/sdn/developerareas/was.sdn?page=test_tool_integration_for_sap_e-catt.htm
http://help.sap.com/saphelp_nw04/helpdata/en/1b/e81c3b84e65e7be10000000a11402f/frameset.htm
http://www.erpgenie.com/ecatt/index.htm
hope this helps.
Reward points for useful Answers
Regards
Anji -
How to upload the data from excel(3 tabs) file to sap environment
Hi all,
This is Mahesh.
how to upload the data from excel(3 tabs) file to sap environment (internal tables) while doing bdc.Hi,
The FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' makes it possible to load a worksheet into an internal table in ABAP.
However, if you want to get the data from several worksheets, I think you are stuck with OLE access to your Excel Workbook...
You can find a solution for 2 worksheets in this post :
TO UPLOAD DATA FROM 2 EXCEL SHEETS INTO TWO INTERNAL TABLES
I think you can easily modify it to handle any number of worksheets.
Hope it helps !
Best regards,
Guillaume
Maybe you are looking for
-
How do I separate my iCloud from my husband's account?
Stupidly, when I got my iPhone, I logged into the same iCloud account my husband uses. It's causing major storage issues. Neither of us can update our phones. I can no longer take pictures. I've deleted all of my texts, keep my voicemails deleted and
-
Credit note with invoice reference are not concatenate in F110
When I create a credit note with invoice reference by VA01, the fields payment term, Baseline date for due date calculation, Assignment and Payment method are copied correctly from invoice to credit note, but in FI document the field invoice ref. '
-
Problems playing music in iTunes with Front Row
Hey Everyone, For some reason when I try and use itunes in front row I either get a message saying "iTunes is not responding" or "this music is not authorized to play on this machine" all the music on my mac IS authorized to me...I dont know why its
-
Doubled plugin windows in 64 bit mode
when I run in 64 bit mode every plugin had two windows, one that has nothing but a name in it, and the other with the actual plugin. This is such an annoyance that I've stopped using 64 bit more just because I couldn't deal with all those extra windo
-
Hi I wonder if you would recommend any good books, which you have found helpful, on understanding action scripts. Nishi