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
Prasenjit
under view put a new tag
<f:view>
<ui:script url="page.js"/>
and thats it
Similar Messages
-
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 -
How to display XML file(as markup) in jsp page..?
Hi All,
* I have to display the XML file(as markup) in jsp page (Tree Format)....
* My XML file is an java.io.file object , and how to view this XML file on my JSP page...........
Thanks in Advance,
JavaImranYou mean you want to see the XML source?
You need to replace the characters '<' and '&' with corresponding entities '<' and '&'. You can use replaceAll, but do the ampersands first.
Then I suggest you probably want to put them in a <PRE> block. -
How to show an xml content in a Jsp page?
I use <jsp:include page=".....xml" /> tag in a jsp file to include an xml file. When this jsp page is open, only the text content in the xml file shows up with plain text. I want this xml file shows up like in IE (with xml format). Does anyone know how to do it? Thanks.
northcloudThank you, BalusC & evnafets. Someone told me to use <c:import> to load the XML file into a scoped variable, and then use <c:out> to display it. The <c:out> will automatically convert the markup to HTML entities. I tried it, it works. It shows the content in the xml file as plain text (a long string). Any one give me some suggestion to make it looking better, for example, show each element in seperated lines. Thanks.
-
How to display result in more than one jsp page
Hi all,
the result is a very large it will take more than one jsp page in this senario how we will display the result in more than one jsp page.
Thanks in Advance.The magic word is "paging". Look around using this keyword.
Basically it's all about subquerying, (eventually) caching and sublisting. -
How to display a variable(non editable) in JSP page?
I have this java code in my JSP and I want to print it on the JSP page with a name associated to it so that it can be passed to a Java Bean. How can I do it?
String user = display.getOwnerName();whatever value you want to send it to server side, you have to put it in a "form". You can put it in HTML form input tag , JSP form, Struts form or JSF form.
for example:
<form action="getUserProfile.do">
<input type="text" value="<c:out value='display.ownerName' />" />
</form>
kind regards -
How to display mutiple form contents on the same page
I have multiple forms for a same page,when i press submit in one form it has to go to next form,where both form contents should display on the same page.Can anyone post example code for this?
Thnx in advance.I have multiple forms for a same page,when i press
submit in one form it has to go to next form,where
both form contents should display on the same
page.Can anyone post example code for this?that's not how it works. when you press submit, the form data is submitted to the server. you can then forward the user to a page with another form, but what you're talking about doesn't make sense -
How to display custom names for attributes in JSP pages
I would like to use custom names for my attributes in Struts JSP table headers.
For example, if the database table named "Country" has a column CNT_ID and BC4J wizard mapped it into an Entity Object's attribute "CntId" I would like to display it as "Country ID" in my JSP table header.
Now, I suppose the place to try this is probably in DataEditComponent.jsp, DataQueryComponent.jsp etc., and probably has smthg to do with jbo:AttributeIterate, but I still can't figure how to achieve this...
I use JDev 9.0.3Kresimir,
It's not clear from your posting whether you've worked out how to do what you want with control hints, so just in case, here's how:
- In the navigator, select your entity object or your view object
- In the structure pane, double-click the attribute you want to edit (CntId)
- In the attribute editor, select the control hints page
- In the Label Text field, type the text you want to use for your label (Country). Click OK.
Hope this helps
Blaise -
How to catch and display a link content in another portlet page?
Can you tell me how to display a URL content into next page after an user click s on this link? I am developing a JSR 168 portlet under a Portal. I have 3 pages so far in my portlet. view.jsp, view2.jsp and IpByHourPage.jsp. view2.jsp displays a lis of IP address. When an user clicks on an IP in view2.jsp, it goes to IpByHourPage.jsp. How to catch the IP address such as 123.23.89.21 that an user just click displayed in IpByHourPage.jsp. I don't know why I got null value returned.
Also, I don't know how to do a "go back to previous page". I want to go back to view2.jsp from IpbyHourPage.jsp
Here is my code
in view2.jsp
<portlet:renderURL var="aURL">
<portlet:param name="goto" value="IpByHourPage"/>
</portlet:renderURL>
<a href="<%=aURL.toString() %> "><%=MyIP%></a>
in IpByHourPage.jsp
<%
String MyIPHour = request.getParameter("goto");
%>
<h1>IP Report by Hour ( <%=MyIPHour%> )</h1>
<portlet:renderURL var="Ret_IPByHour">
<portlet:param name="Ret_IPHourPage" value="Ret_IPByHourPage"/>
</portlet:renderURL>
<center> <a href="<%=Ret_IPByHour.toString() %> "><b>Choose Another IP</b></a></center>
in my .java file
protected void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException, UnavailableException {
response.setContentType("text/html");
String MyBegDate = request.getParameter("BegDate");
String MyEndDate = request.getParameter("EndDate");
String MyNetworks = request.getParameter("networks");
String MyYourName = request.getParameter("yourname");
PortletURL renderURL = response.createRenderURL();
renderURL.setPortletMode(PortletMode.VIEW);
request.setAttribute("renderURL", renderURL.toString() )
String GotoRenderAction = request.getParameter("goto");
String MyIPHourAction = request.getParameter("Ret_IPHourPage");
if ( (MyIPHourAction!=null) && MyIPHourAction.equals("Ret_IPByHourPage") )
PortletRequestDispatcher kk = getPortletContext().getRequestDispatcher("/view2.jsp");
kk.include(request, response);
if (MyIPHourAction != null && MyIPHourAction.equals("Ret_IPByHourPage"))
PortletRequestDispatcher mm = getPortletContext().getRequestDispatcher("/view2.jsp");
mm.include(request, response);
if (GotoRenderAction != null && GotoRenderAction.equals("IpByHourPage"))
request.setAttribute("BegDate", "MyBegDate");
request.setAttribute("EndDate", "MyEndDate");
System.out.println("BegDate" + MyBegDate);
System.out.println("Endate" + MyEndDate);
PortletRequestDispatcher mm = getPortletContext().getRequestDispatcher("/IpByHourPage.jsp");
mm.include(request, response);
if(MyEndDate!= null )
PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/view2.jsp");
prd.include(request, response);
else if (MyEndDate==null && GotoRenderAction == null)
PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/view.jsp");
prd.include(request, response);
The problem for above code is the clicked single IP can not be displayed in IpByHourPage.jsp. and I cannot go back to view2.jsp from IpByHourPage.jsp. when I click "Choose Another IP"
I find out that the MyBegDate and MyEndDate values are all null when I click Choose Another IP link. I got the following error message
Caused by: javax.servlet.ServletException: Unparseable date: "null null"
at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
at org.apache.jsp.view2_jsp._jspService(view2_jsp.java:651)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
How to fix above problems. ThanksI think the problems are related to portletsession. But I don't know how to use it. How to put portletsession into doview method or my jsp pages. Can anyone tell me in my code? Thanks a lot.
-
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 -
How do I access documents stored on my ipad pages on my mac?
How do I access documents stored on my ipad pages on my mac?
kailfromva wrote:
How do I access documents stored on my ipad pages on my mac?
Do you have the Mac OS version of Pages installed on your Mac...? -
How to display discount price amt in order confirmation page
hi,
I created a discount for site,who places any order will get a discount for that particular order ,How to display discount price amt in order confirmation page.suggest some points guys.Try displaying it as following , just put the jsp code for the if() statement i have put below.
This block loops through order level adjustments and displays the discounts for the one's associated with order promotions.
<dsp:droplet name="ForEach">
<dsp:param name="array" bean="ShoppingCart.current.priceInfo.adjustments" />
<dsp:param name="elementName" value="pricingAdjustment" />
<dsp:oparam name="output">
//displaying if discount was provided, associated with some order level promotion
if (pricingAdjustment.getPricingModel() != null && pricingAdjustment.getAdjustment() < 0) {
<dsp:valueof param="pricingAdjustment.totalAdjustment" />
</dsp:oparam>
</dsp:droplet> -
How to display a user message on WEBI Home page ?
Hi all,
How to display a user message on WEBI Home page ?
like when ever the data gets scheduled at etl side i want to display a message a message on info view home page "new data is uploading" is this is possible to do ?Unfortunately this is not possible to do "out of the box". There aren't any pre-configured options that will let you do this. You're only real option is to try and modify the infoview source code yourself to do this.
Regards,
Shawn -
How to use custome tag lib in the JSP page?
How to use custome tag lib in the JSP page?...with JDeveloper
http://www.oracle.com/webapps/online-help/jdeveloper/10.1.2/state/content/navId.4/navSetId._/vtTopicFile.working_with_jsp_pages%7Cjsp_ptagsregistering~html/
Maybe you are looking for
-
ive got a mac book pro i bought the lead to connect to the tv but is there a lead for the sound to come out of the tv and not the laptop?
-
Support patches for SOLMAN 7.0
Hi experts, We are running on lower patch level for our Solution Manager, now we want to upgrade the same till latest available. now the problem is when i am loading all the patches into queue, it is not getting imported fully which is not giving com
-
How to make a thumbnail to triger a lightbox with a several images inside and navigation option
hy ive tryd the the tooltip but it wont let me to navigate in the lightbox any idea?
-
Hi I'am having a little trouble with my site I would like to know what is the normal flash dimension(properties) size for a flash page that covers the whole browser withou any scrollers on the side or bottom. My page seems to be too big and I've trie
-
Changing ALLOCATION_TYPE for a tablespace
Hi, I dropped one tablespace and re-created it in Oracle 9i database,but after the creation when i checked the ALLOCATION_TYPE its value is SYSTEM,is there any way to change it to USER which is what required. Regards, Cherry