How to display a document content in JSP page
Hi friends,
I am trying to display a document's content in a JSP page after user authentication.For that I mapped a jsp file with extension .sens in Content Management SDK manager,and put it the file in the directory '/ifs/jsp-bin' of webstarterapp,but it is not working.Down I am giving the code snippet,please help me.I need this to be done fast.
<HTML>
<HEAD>
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ page import="oracle.j2ee.connector.Login" %>
<%@ page import="oracle.ifs.adk.filesystem.IfsFileSystem"%>
<%@ page import="oracle.ifs.adk.http.HttpUtils"%>
<%@ page import="oracle.ifs.beans.LibrarySession"%>
<%@ page import="oracle.ifs.beans.DirectoryUser"%>
<%@ page import="oracle.ifs.beans.PublicObject"%>
<%@ page import="oracle.ifs.beans.Document"%>
<%@ page import="java.io.*"%>
<jsp:useBean id="login" scope="page" class="oracle.j2ee.connector.Login">
<TITLE>FileExtension.jsp</TITLE>
</HEAD>
<BODY BGCOLOR="SILVER">
<%
String theDisplay = "initialized";
String theHidden = "initialized";
boolean theAdminRights = false;
try
login = (Login) request.getSession(true).getValue("IfsHttpLogin");
LibrarySession ifsSession = login.getSession();
IfsFileSystem ifsFile = new IfsFileSystem(ifsSession);
DirectoryUser du = ifsSession.getDirectoryUser();
String path = HttpUtils.getIfsPathFromJSPRedirect(request) ;
PublicObject po = ifsFile.findPublicObjectByPath(path);
if(po instanceof Document)
Document doc =(Document) po;
InputStream in= ifsFile.getDocumentContent(doc);
int i=in.read();
while(i!=-1)
out.write(i);
in.close();
out.flush();
out.close();
theAdminRights = du.isAdminEnabled();
theDisplay = po.getAttributeByUpperCaseName("DISPLAY").toString();
theHidden = po.getAttributeByUpperCaseName("HIDDEN").toString();
catch (Exception e)
e.printStackTrace();
%>
Here is some static content.
<P>
The Display Value: <%= theDisplay %>
<P>
<%
if (theAdminRights)
%>
The Hidden Value: <%= theHidden %>
<%
%>
</jsp:useBean>
</BODY>
</HTML>
these may help you.
Google map integration to EBS
Similar Messages
-
How to display a document content in a JSP page
Hi friends,
I am trying to display a document's content in a JSP page after user authentication.For that I mapped a jsp file with extension ".sens" in Content Management SDK manager,and put the file in the directory '/ifs/jsp-bin' of webstarterapp,but it is not working.Please help me to solve the probleb as earliest.
Regards
Prasenjitunder view put a new tag
<f:view>
<ui:script url="page.js"/>
and thats it -
How to display japanese charecters in the JSP page
Hi,
Below is my jsp page where i am trying to read the japan character from the properties file
through the Resource bundle.
===============================================
<%@page contentType="text/html" %>
<%@page pageEncoding="UTF-8"%>
<%@ page import ="java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>JSP Page</h1>
<%Locale locale = new Locale(request.getParameter("country"));
ResourceBundle bundle = ResourceBundle.getBundle("com.sunit.regtool.resources.RegTool",locale);
String namelabel =bundle.getString("userName");
String passwordlabel= bundle.getString("password");
%>
<%=namelabel %>
</body>
</html>
=========================================================
In the above code i am getting the value of the country from request object i.e its value
will be en for English ,ja for japanese etc.
I am able to get the value from Resource bundle but when my country is japan
i am not able to see the same japan characters in the browser when i get the JSP on the browser at runtime .
It shows me " �����…� ˆ�ƒ•�‚��ƒ��ƒ��ƒ‰" where the charecters are different.
But when i see in the properties file it is fine.
Please help me what need to be done furher for this.
Thanks,
KiranI think you need to install japanese language fonts in your browser.
-
Hi all.... how to display tables dynamically in a JSP page
im trying to display the list of tables in MYSQL datbase into a JSP.... i have a database name link on the page.... once i click on that the list of tables should be listed dynamically in the page as a link...Also is it possible to click on each table link and go to see the table details ...if so how.... please some one help me ...its very urgent........
im trying to display the list of tables in MYSQL
datbase into a JSP.... i have a database name link on
the page.... once i click on that the list of tables
should be listed dynamically in the page as a
link...Also is it possible to click on each table
link and go to see the table details ...if so how....DatabaseMetaData has a method (look in the documentation) to get the list of tables. It also has methods to get information on specific database objects
please some one help me ...its very urgent........It's even urgent that you look in the documentation. -
How to display a html report on jsp page---urgent
i want to display a html report wen a tab is clicked.can any tell me how to do tat.
Didn't quite get your requirement. What do you mean by an HTML report?
-
How to display a pdf file in jsp
hi,
How to display a pdf file in jsp iam having a class which will return fileinputstream of the file object. the pdf file is in server.
regards
ArulA JSP is a combo of HTML and Java, so you can't really "display" a PDF file in a JSP.
You can provider a href link to the PDF file in your JSP.
You can use some utility package to read the contents of the PDF, pull certain things out of it, and display that in your JSP as html
In a servlet you can set the content type to application/pdf and write the binary data of the PDF back to the browser. Once the browser finishes reading in the data it should open the PDF. -
How to display the variable content in message?
Hi anybody
please let me know How to display the variable content in message?
please send few lines of sample code to understand that
thanks in advanceHi,
Check out the link
http://help.sap.com/saphelp_nw70/helpdata/en/2c/840b42202cce6ce10000000a155106/content.htm
REPORT Y9020027 LINE-SIZE 130. "Release 3.1G, 4.5A
BREAK-POINT.
MOVE: 'TESTREPORT for "ASSIGN FFeld+o(l) TO " '
TO SY-TITLE.
Declaration of variables **********************
FIELD-SYMBOLS <FS1>.
DATA: FFELD8(8) TYPE F VALUE '1022333'. "Unusual: Explicit 8 bytes
*DATA: ZFELD1(2) TYPE N. "Here slack bytes are (DW border)
"necessary
"If you like computing error, please uncomment the above
DATA: FFELDX(8) TYPE F VALUE '7777777'.
DATA: FFELDA(8) TYPE F VALUE '7333213'.
DATA: NFELDX(400) TYPE N.
DATA: OFFX(4) TYPE I VALUE 160.
DATA: LENX(4) TYPE I VALUE 8.
Main Section *******************
SKIP.
WRITE: /5 'Example 1 **** inadmissible ASSIGN ***' COLOR 6.
WRITE: /10 'Inadmissible ASSIGN: ''ASSIGN FFELD4+1(3) TO <FS1>'' '.
ASSIGN FFELD4+1(3) TO <FS1>.
ULINE.
SKIP 2.
SKIP.
ASSIGN FFELD8+8(8) TO <FS1>. "<-- Assigning of variable FFELDX !!
BREAK-POINT.
WRITE: / 'ASSIGN command with FFELD8, but FFELDX will be assigned'
COLOR 3.
WRITE: /5 'Example 2'.
PERFORM DISPLAY-FFELD USING FFELD8 'FFELD8'.
WRITE: /10 'Content of FFELDX :', FFELDX.
ULINE. SKIP 2.
SKIP.
ASSIGN FFELD8+16(8) TO <FS1>. "<-- Assiging a few FFELDA to <FS1>
BREAK-POINT.
WRITE: / 'ASSIGN with FFELD8, but instead FFELDA is assigned'
COLOR 3.
WRITE: /5 'Example 3'.
WRITE: /10 'Content of FFELDA :', FFELDA.
PERFORM DISPLAY-FFELD USING FFELD8 'FFELD8'.
WRITE: /10 'Content of FFELDA :', FFELDA.
ULINE. SKIP 2.
BREAK-POINT.
DO 4 TIMES.
ASSIGN FFELD8+OFFX(LENX) TO <FS1>. "Zuordnung auf OFFX zu <FS1>
WRITE: / 'ASSIGN command with FFELD8, es wird NFELDX zugeordnet'
COLOR 5.
WRITE: /5 'Example 4', 'DO-Schleife Nr.:', SY-INDEX.
PERFORM DISPLAY-FFELD USING FFELD8 'FFELD8'.
WRITE: /10 'Content of NFELDX145(40) :', NFELDX145(40).
ULINE. SKIP 2.
ADD 8 TO OFFX.
ENDDO.
Subroutines *******************
Display of data fields and field symbols *
FORM DISPLAY-FFELD USING FFELD FNAME.
WRITE: /10 'Content of', FNAME, ':', FFELD.
PERFORM FELDEIGENSCHAFTEN USING FFELD.
WRITE: /10 'Content of <FS1> :', <FS1>.
PERFORM FELDEIGENSCHAFTEN USING <FS1>.
ADD 111 TO <FS1>. "<-- Das Feldsybmol wird verwendet
WRITE: /10 'ADD 111 TO <FS1>'.
ULINE.
WRITE: /10 'Content of', FNAME, 35 ':', FFELD.
WRITE: /10 'Content of <FS1>', 35 ':', <FS1>.
ENDFORM.
Determination of field properties (only for information) *
FORM FELDEIGENSCHAFTEN USING ALLG.
DATA: FLAENGE(2) TYPE N.
DATA: FTYP(1) TYPE C.
DATA: FOUT(2) TYPE N.
DATA: FDEZ(2) TYPE N.
ULINE.
DESCRIBE FIELD ALLG LENGTH FLAENGE.
WRITE: /10 'Field length :', FLAENGE.
DESCRIBE FIELD ALLG TYPE FTYP.
WRITE: /10 'Field type :', FTYP.
DESCRIBE FIELD ALLG OUTPUT-LENGTH FOUT.
WRITE: /10 'Output length :', FOUT.
DESCRIBE FIELD ALLG DECIMALS FDEZ.
WRITE: /10 'Decimals :', FDEZ.
SKIP 1.
ENDFORM.
END OF PROGRAM ************************************* -
How to display the same content in the two different main windows?
Hi experts,
How to display the same content in the two different main windows?
Thanks in advance.
sarathHi
Sorry but you can't have two main windows in sapscripts.
Regards
Gregory -
JSP: How do display list of objects in jsp table?
sorry that my question my confuse you, let me explain more.
in my java class, have method : public List retrieveAllVacancies(); and it returns a list of available vacancies.
on my jsp page, i want to display the vicancies in the table have 3 rows:
vacancy title | location | contract type
should i use some form of for loop or iterator to get the vacancies in the list? how does the jsp page get the list of objects?
anyone can help me? thanksi found out the actual thing i look for is how to pass the vector to the jsp page.
<table>
<%
Vacancy vacancy= new Vacancy();
Vector allVacancies = new Vector();
*//allVacancies = (java.util.Vector)request.getAttribute("allVacancies");*
if(allVacancies.size() == 0)
out.print("<br><br><br> There are no vacancies available!!");
else
%>
<tr>
<td>Vacancy Title</td>
<td>Contract Type</td>
<td>Location</td>
</tr>
<%
for (int i=0;i<allVacancies.size();i++)
vacancy = (Vacancy)allVacancies.get(i);
%>
<tr>
<td><% out.print(vacancy.getVacancyTitle());%></td>
<td><% out.print(vacancy.getContractType());%></td>
<td><% out.print(vacancy.getVacancyLocation()); %></td>
</tr>
<%
%>
</table>*//allVacancies = (java.util.Vector)request.getAttribute("allVacancies");*
if i have this line, when i open the jsp page it will gives NullPoniterException.
the following was what i found for the similar problem,
You can add the Vector to the HttpSession with_
session.setAttribute(String name, Object value)_
or to the ServletRequest with_
request.setAttribute(String name, Object value)._
In the other JSP, retrieve the value with_
session.getAttribute(String name)_
or to the ServletRequest with_
request.getAttribute(String name)._
but i tried to do in this way it didn't work. for sure i didn't do it correctly. could anybody give bit more explanation about how to pass the Vector to the jsp page?
any help would be appreciated. -
Displaying Crystal reports in a JSP Page
hello,
Can anybody help me out in displaying Crystal reports on a JSP page.
which needs to be deployed on weblogic server and oracle database.
i am new to crystal report and dont have much idea how to proceed.
if you can give me a pointer how to start then i can proceed.
waiting for the reply eagerlyStart with the Crystal reports site.
[url http://www.businessobjects.com/products/dev_zone/java/default.asp?ref=devzone_main] Java zone has some documentation and basic examples on how to do it -
Displaying pdf file in a jsp page...
hi,
I want to display a pdf document in a jsp page. i got that pdf file from a servlet class(MVC Architecture) through session. now my problem is to display that pdf file in my jsp page. can anyone give me a idea to solve this problem..hi,
i used that code in scriplets. Actually my problem is I got one pdf file from session and i stored that file in a File object. the code is ..
File pdfDocument = (File) session.getAttribute(CommonConstants.EBILL_PDF_DOCUMENT);
now i have to display this pdf file in jsp.. -
How to get context sensitive help in JSP Pages
Is it possible to display context sensitive help in JSP Pages when I press the tab key on the keyboard base on the key focus. I don�t want to use any applet or Swing components, because it�s a web page viewed on the browser
ThanksJava code inside a JSP is interpreted on the server and the HTML produced by the server it is shown in the client browser. The JSP code can incorporate calls to the JavaHelp API if it is available to the server. Those calls can be used on the server side to map parts of the JSP to contents of a help set (HTML pages).
Given that, you can provide context sensitive help, but when it comes to view help information, you either can show HTML only (without TOC, index, etc.) or you'd need an applet.
Ulrich -
How do i use Connection pool in JSP pages
Hey everyone,
I am using a connection pool in my web application. I am using DbConnectionBroker from Javaexchange.com. It has a class that creates a connection pool available for the servlets. I am trying to figure out that how to use connection pool within the JSP pages if I want to connect to the database. In the servlets i am using DBConnectionBroker pool = (DbConnectionBroker) getServletContext().getAttribute("dbPool") to get database connection. How Can i use this in JSP page to get a db connection.
ThanksIf the reference to the connection pool is already stored as an ServletContex attribute, try:
<jsp:useBean id="dbPool" scope="application" class="com.javaexchange.dbConnectionBroker" />
<%
Connection con = dbPool.getConnection();
%> -
How to display horizontal line in top-of-page by using object oriented ALV?
How to display horizontal line in top-of-page by using object oriented ALV.
I am created top-of-page in object oriented alv.
But not be successes in showing horizontal line in it.
Can any one pls give solution for this..
Thanks and regards..Hi
Try like this
data: gt_list_top_of_page type slis_t_listheader. " Top of page text.
Initialization.
perform comment_build using gt_list_top_of_page[].
form top_of_page.
* Note to self: the gif must be loaded into transaction OAOR with
* classname 'PICTURES' AND TYPE 'OT' to work with ALV GRID Functions.
* I Loaded NOVALOGO2 into system.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
* I_LOGO = 'NOVALOGO2'
* i_logo = 'ENJOYSAP_LOGO'
it_list_commentary = gt_list_top_of_page.
endform. " TOP_OF_PAGE
form comment_build using e04_lt_top_of_page type slis_t_listheader.
data: ls_line type slis_listheader.
clear ls_line.
ls_line-typ = 'A'.
ls_line-info = 'Special'(001).
fgrant = xgrant.
concatenate ls_line-info fgrant
'Stock Option Report to the board'(002)
into ls_line-info separated by space.
condense ls_line-info.
append ls_line to e04_lt_top_of_page.
endform. " COMMENT_BUILD
Use following syntex for footer print in alv:
* For End of Page
form END_OF_PAGE.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
write: sy-uline(50).
skip.
write:/40 'Page:', sy-pagno .
endform.
* For End of Report
form END_OF_LIST.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
skip.
write:/40 'Page:', sy-pagno .
endform.
check this link
http://abapprogramming.blogspot.com/
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5dc3e690-0201-0010-1ebf-b85b3bed962d
Changing width of a custom container dynamically
Display Page numbers in ALV
Insert picture in selection screen.
Logo in OO ALV Grid
Reward all helpfull answers
Regards
Pavan -
HOW TO DISPLAY THE TEXT ON A PARTICULAR PAGE IN SAPSCRIPTS
HI,
HOW TO DISPLAY THE TEXT ON A PARTICULAR PAGE IN SAPSCRIPTS?in ur script main window
/: IF &TTXSY-PAGE& = 15.
ur text or standard text
/: ENDIF.
use this.
hope it helps if any issues revert back
Maybe you are looking for
-
After Factory Reset - the dreaded 3F0 message "please install an operating system".
I have seen numerous threads on the 3F0 message relating to missing HDD/OSes but none seem to match mine. I have an (albeit old) HP Envy 13-1050EA, I decided to completely refresh it and go back to factory reset state. The reset completes succesfull
-
How to change the background color ?
Hi ! I wonder if I could change the background color in my webpage http://web.mac.com/wiktorkidziak/iWeb/ (I mean the white part) using iWeb ? Regards, Wiktor
-
Mac Mini and the HP Photosmart All in One Scanner
When I got my Mac Mini from MacMall, I got the free HP Printer (C3180 Photosmart all in one) printer works fine, copier works fine, but I am not able to Scan. HP is no help because their chat customer service reps "are only trained on PC related issu
-
Can anybody tell me what HDMI standard the mid 2011 Mac mini supports please? 1.4 or 1.3?
-
I have a client that has asked me to cleanup book files for output to a printer. The container file is an InDesign file with 48 pages that have lots of linked low res graphics. He wants me to convert all the hi res RGB JPG images to CMYK, 300 ppi (no