Link Problem in JSP Dynpage
Hi Folks,
My requirement is as follows.
I have jsp file being integrated with JSPDynpage.on the left hand side of the jsp file I am trying to call one more jsp file on hyperlink.I have all my jsp files under pagelet/webapps/holcim/jsp folder.
But my problem is when I click the hypelink in the first jsp I am not able to go the second jsp.It says the reqd file is not found.
I tried with componentRequest.getWebResourcePath() also.Nothing worked?
The above scenario works perfectly in Tomcat.
Any clues you will be rewarded for really helpful answers.
Regards,
Guru
Hi Guru,
In order to access the JSP's via url, you need to create a new component in your portalapp.xml as such:
<component name="Help">
<component-config>
<property name="ComponentType" value="JSPNative"/>
<property name="JSP" value="pagelet/help.jsp"/>
</component-config>
Then in order to create your link in the JSP do the following:
<% String componentName = componentRequest.getComponentContext().getApplicationName();
String helpUrl = "/irj/servlet/prt/portal/prtroot/"+componentName+".Help";
%>
Hope this helps,
Marty
Similar Messages
-
Urgent : Data Passing Problem in JSP dynpage using bean in SP11
Hi all
I am trying to pass data from my jspdynpage to jsp using bean , which is not at all passing any values
i am pasting code below which works in 6.0 sp09
I dont know what is happening in sp11
please suggest me in this situation
public static class LeaderStatusOverviewDynPage extends JSPDynPage{
private LeaderStatusBean myBean = null;
public void doInitialization(){
this.ensureBeanisSetup();
public void doProcessAfterInput() throws PageException {
public void doProcessBeforeOutput() throws PageException {
this.setJspName("leaderstatus.jsp");
public void ensureBeanisSetup(){
IPortalComponentRequest request = (IPortalComponentRequest)this.getRequest();
IPortalComponentContext myContext = request.getComponentContext();
//IPortalComponentProfile profile = myContext.getProfile();
Object o = myContext.getValue("myBean");
if(o==null || !(o instanceof LeaderStatusBean)){
myBean = new LeaderStatusBean();
myBean.setMessage("This String From Bean");
myContext.putValue("myBean",myBean);
} else {
myBean = (LeaderStatusBean) o;
My jsp page
<jsp:useBean id="myBean" scope="application" class="bean.LeaderStatusBean" />
<hbj:content id="myContext" >
<hbj:page title="PageTitle">
<hbj:form id="myFormId" >
<% Date today = new Date(); %>
<h1> This is Test page for NOVA Chemicals </h1>
<br><br>
<font color = "blue" size = "4"><center>
<%=today%>
</center>
<br><br> This is the message of Connection :
<%=myBean.getMessage()%>
</font>Hallo Prakash,
I am developing with EP SPS12 and am facing the exact same situation. Values passed to the bean from the dynPage do not get through to the jsp. When removing the respective lines in the portalapps.xml I get a portal runtime exception.
I am posting my portalapps and the jsp where importing the beans. What am I missing here? Any help would be greatly appreaciated! Thank you in advance.
BR
Helga
<?xml version="1.0" encoding="utf-8"?>
<application>
<application-config>
<property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
</application-config>
<components>
<component name="AdminComponent">
<component-config>
<property name="ClassName" value="com.company.AdminComponent"/>
<property name="SecurityZone" value="com.company.AdminComponent/low_safety"/>
<property name="ComponentType" value="jspnative"/>
<property name="JSP" value="pagelet/AdminComponentView.jsp"/>
</component-config>
</component>
</components>
<services/>
</application>
<jsp:useBean id="dropDownListBean" scope="application" class="com.company.bean.DropDownListBean" /> -
Using hyper-links in a jsp pages that are in a Session
Hi i am trying to include a hyper-links in my jsp pages that are in a Session, however when i use the links to navigate throughout the pages i get a java.lang.NullPointerException. The Session begins after the user has been validated i.e
String cid= request.getParameter("counsellorID")
session.setAttribute("counsellorID",cid);
All the pages included within the session have a session scope=session
; and they call the attributes that have been set when the session first begins i.e
String counsID= (String) (session.getAttribute("counsellorID"));
Any advice on this problem would be most appreciated!
Many Thanks
Stephencheck if you borwser have cookies enabled
-
I created a JSP Dynpage via NWDS.
based on the sampples at <a href="http://help.sap.com/saphelp_nw04/helpdata/en/19/4554426dd13555e10000000a1550b0/frameset.htm">SAP Help Creating the JSPDynPage</a>
When I run it, I got the error:
Error in parsing taglib 'tagLib' tag in web.xml or .tld file of the taglib library..
Any point where I can start looking? Is anyone having a better documentation to look at than this rather puristic description?Thanks for your input.
Do you have any specific links for JSPDynpages? Since most of the DevStuff is about WebDynpros, which I don't plan to use here.
I updated portal.app, but I am not sure if it is right:
<?xml version="1.0" encoding="utf-8"?>
<application>
<application-config>
<property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
<property name="SharingReference" value="htmlb"/>
</application-config>
<components>
<component name="log2UME">
<component-config>
<property name="ClassName" value="log2UME"/>
<property name="ComponentType" value="jspnative"/>
<property name="JSP" value="pagelet/log2UME.jsp"/>
</component-config>
<component-profile>
<property name="tagLib" value="SERVICE/htmlb/taglib/htmlb.tld"/>
</component-profile>
</component>
</components>
<services/>
</application>
and the jsp page:
%-- OutputText.jsp --%>
<%@ taglib uri= "tagLib" prefix="hbj" %>
<hbj:content id="myContext" >
<hbj:page title="PageTitle">
<hbj:form id="myFormId" >
<hbj:textView
id="welcome_message"
text="May the force be with you unknown user"
design="HEADER1" />
</hbj:form>
</hbj:page>
</hbj:content> -
I wish to debug a JSP dynpage project.
For that I selected Debug perspective and then Create Manage and Run Configuarations. There I selected Remote Java application.
I get a message "Failed to connect to remote VM. Connection refused".
I entered localhost and 5000 as port. Is there any problem with it?Hello Prem,
You should start your J2EE-Server in Debug mode to be able to debug:
Steps to follow to start J2EE-Server in Debug mode
1. Run ConfigTool "configtool.bat" which is under path "C:\usr\sap\J2E\JC00\j2ee\configtool\configtool.bat"
2. In ConfigTool goto -->
cluster-data>instance_ID*****>server_ID******
then on the right details-window, goto Tab "Debug".
Select the check box "Debuggable" and Check box "Enable debug mode" and set a "Debug port" generally 50021.
Now restart server and try connecting to the remote VM with your Debug port.
Greetings,
Praveen Gudapati -
Hi,
I have implemented reading an XML feed in a Java program using informa api.
In NWDS, I created a Java Project. And as required added 3 externals jar files.
I had to import the following:
import de.nava.informa.core.ChannelIF;
import de.nava.informa.core.ItemIF;
import de.nava.informa.impl.basic.ChannelBuilder;
import de.nava.informa.parsers.FeedParser;
The program works on run.
But when I creat a JSP DynPage and I add the follwoing lines:
<%@ page import = "de.nava.informa.core.* "%>
<%@ page import = "de.nava.informa.impl.basic.ChannelBuilder "%>
<%@ page import = "de.nava.informa.parsers.FeedParser "%>
I get an error: Error occurs during the rendering of jsp component. Even in this project I added external Jar files in the same way.
Any particular stuff need to reside on the server or something?
Because I one tried implementing JCO in JSPDynPage by adding the external jar in the project structure and it worked fine.Hi Prem,
Probably the jars you must have added in your last project would be available on the server or they would have been some server related jar files.
But in the case when you are inclusing some external jars, you need to inclusde it both as "<b>External Jar</b>" and also add it to the <b>lib</b> folder (ie: just copy and pate the jar files in the <b>lib</b> filder).
<b><a href="http://img142.imageshack.us/img142/8168/solution4gy.jpg">Put the .jar file here</a></b>
I hope this solves your problem.
Regards
Pravesh
PS: Please consider rewarding points if helpful and solved. -
Hi there,
I have developed a portal application using JSP Dynpage which calls R/3 BAPI but I have a strange issue here.
This application calls BAPI and displays it using HTMLB table control.
When returned values from R/3 are small, it is OK. The problem is when large amount of data comes from R/3, data is correctly displayed but Bean seems to be cleared after displaying it. Therefore if one clicks any button on the applicaiton, NullPointerException occurs due to null bean.
Bean scope is "Application".
Do you have any experience like this? Any input is appreciated!
Regards,
KazuyaAt the moment there is a lot of ambigious information about this, and I've asked for some weblog tying it all together (see Bean scope storage confussion)
You problem is that beans in the application scope can be deleted at anytime if the SAP J2EE needs memory. Try the session scope (or search the forums, lots of people have had the same problem before) -
Try to link to internal jsp pagegs
Hi there.
I try to link from one .jsp to anohter .jsp Page. They're both located the same .par and there in the same directory.
So I'm not able to get them linke successfully by using either a native html <a href=...> or using the <hbj:link...
Here some infos:
<% String strWRoot = componentRequest.getWebResourcePath(); %>
<hbj:link
id="link1"
text="BlaBla"
reference="<%= strWRoot+\"/jsp/myPage.jsp\"%>"
target="_TOP"
tooltip="BlaBla"
onClick="LinkClick"
/>
I think problem is getting the right ressource path. So I also tried:
<% String strPubPath = componentRequest.getPublicResourcePath(); %>
But no success.
Bye.So now we get I little closer. The JSP is an AbstractportalComponent, but no JSPDynPage.
Here's the .java:
package one;
import com.sapportals.portal.prt.component.*;
import com.sapportals.portal.prt.resource.IResource;
o now we get I little closer. The JSP is an AbstractportalComponent, but no JSPDynPage.
Here's the .java:
package one;
import com.sapportals.portal.prt.component.*;
import com.sapportals.portal.prt.resource.IResource;
public class myPageOne extends AbstractPortalComponent
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
IResource jspResource = request.getResource(IResource.JSP, "jsp/myPageOne.jsp");
response.include(request, jspResource);
Now in myPageOne.jsp I want to link to myPageTwo.jsp which is also a AbstractPortalComponent and the .java looks like:
package two;
import com.sapportals.portal.prt.component.*;
import com.sapportals.portal.prt.resource.IResource;
public class myPageTwo extends AbstractPortalComponent
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
IResource jspResource = request.getResource(IResource.JSP, "jsp/myPageTwo.jsp");
response.include(request, jspResource);
Now i change the .jave of myPageOne to:
package One;
import com.sapportals.portal.prt.component.*;
import com.sapportals.portal.prt.resource.IResource;
public class myPageOne extends AbstractPortalComponent
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
IResource jspResource = request.getResource(IResource.JSP, "jsp/Intro_v5.jsp");
response.include(request, jspResource);
public void linkToPageTwo(IPortalComponentRequest request, IPortalComponentResponse response){
IResource jspResource = request.getResource(IResource.JSP, "jsp/Intro_v3.jsp");
request.dispatchRequest(jspResource, response);
...and i changed the JSP to:
<hbj:link
id="link1"
text="BlaBla"
reference=""
target="_TOP"
tooltip="this takes you to: http://www.google.com"
onClick="linkToPageTwo();"
/>
...without Success.
Perhaps I didn't really understood you..? -
JSP Dynpage runtime error - Urgent
Hello All,
I have a JSP Dynpage application with 1 jsp file and one bean (TestProject, test.jsp,test.class). My Problem - After deploying the par file on one portal (Ex: PORTAL1) when I run the component from portalapp.xml, I am getting the following error:
>>> JSPCompiler >>> ERROR in Compiling :JSPFileInfo :987761117
JSP File : /opt/usr/sap/PORTAL1/JC00/j2ee/cluster/server0/apps/sap.com/irj/servlet_jsp/irj/root/web-inf/portal/portalapps/testproject/pagelet/test.jsp
Class Name: sapportalsjsptest
Java File : /opt/usr/sap/PORTAL1/JC00/j2ee/cluster/server0/apps/sap.com/irj/servlet_jsp/irj/root/web-inf/portal/portalapps/testproject/work/pagelet/_sapportalsjsp_test.java
Package Name : pagelet
Class File : /opt/usr/sap/PORTAL1/JC00/j2ee/cluster/server0/apps/sap.com/irj/servlet_jsp/irj/root/web-inf/portal/portalapps/testproject/work/pagelet/_sapportalsjsp_test.class
Is out dated : false [email protected]8b467
When I deployed the same project on another portal (PORTAL2), I do not have any problems. When I compared the project structure of this project on both the portals - from ROOT/WEB-INF/portal/portalapps/TestProject/work I found that these three files are missing from PORTAL1. Somehow these three files are not generated on PORTAL1 but generated on PORTAL2.
Any ideas why this is happening? Is something missing on PORTAL1?
What is this work folder? I could not find it on NWDS. Is it generated only on Portal.
Please help me as this is Urgent.
Thanks,Hi Srinivas,
Thanks for your response. I looked at the complete log - the jsp file is not compiled into a java file and the error is about this missing file. I don't think there is anything wrong with the code because, this does not happen on the other portal. The JSP file is compiled into java file and I can run the component without any errors.
Also on the portal with problems, I cannot deploy any par file. I am getting the same error in all the applications. Can this be a version issue?
Thanks -
JSP Dynpage iView 'Open in New Window' losses session data
Hi All,
I have a JSP Dynpage that displays some position holder information based on a position id passed in by the URL query string. The problem that I am trying to solve is to allow the user to open the iView in its own window by using the 'Open in New Window' option from the button in the upper right of the iView title bar. When this happens the URL query string is no longer available so the iView has problems. My solution is to store the position id in the session object then read from that session object when the query string is not available - when opening in a new window.
But what is happening is that the position id saved in the session object is no longer there when the new window opens. I have looked else where on this site but all posts seem to deal with data transfer from JSP Dynpage to the JSP page. This issue is dealing with a page getting re-opened in a new page (browswer).
I can't seem to get the session object to work between JSP Dynpages at all, I would think that the data put into the session would stay there untill either cleared or the session ends. Am I missing some configuration settings? I have included some of the key code below.
// GET THE POSITION ID FROM THE URL QUERY STRING
String PosId;
PosId = request.getParameter("CKey");
if (PosId == null)
myBean.testing = (String) request.getComponentSession().getValue("PosId");
else
PosId = PosId.substring(6, 14);
request.getComponentSession().putValue("PosId", PosId);
myBean.testing = "POSID:" + PosId;
Thanks for all ideas and help.
DonAll of this logic is within the doProcessBeforeOutput event. Here is all my java code and JSP...
<%@ taglib uri="tagLib" prefix="hbj" %>
<hbj:content id="myContext" >
<hbj:page title="PageTitle">
<hbj:form id="myFormId" >
<jsp:useBean id="myBean" scope="application" class="MSSBeanPackage.HolderDetailBean"></jsp:useBean>
<% response.write("<br>xxxx-" + myBean.testing + "-zzzz<br>"); %>
<hbj:textView id="txtEname" text="<%=myBean.getEname()%>" design="HEADER2"/>
<hbj:textView id="txtPernr" text="<%='(' + myBean.getPernr() + ')' %>" design="HEADER3"/>
<hbj:gridLayout rowSize="1" columnSize="1" cellSpacing="2">
<hbj:gridLayoutCell columnIndex="1" rowIndex="1" width="100%" verticalAlignment="TOP">
<hbj:group id="grpContractData"
design="SAPCOLOR"
title="Contract Data"
tooltip="Contract Data"
width="100%">
<hbj:groupBody>
<hbj:formLayout id="myForm"
marginTop="5px"
marginRight="5px"
marginBottom="5px"
marginLeft="5px"
width="300px" >
<hbj:formLayoutRow id="Row1" paddingTop="1px" paddingBottom="1px" >
<hbj:formLayoutCell id="Cell11" align="LEFT" width="40%" >
<hbj:label
id="label_WorkContract"
text="Work Contract xx"
design="LABEL"
labelFor="WorkContract"></hbj:label>
</hbj:formLayoutCell>
<hbj:formLayoutCell id="Cell12" align="LEFT" width="40%" >
<hbj:textView
id="WorkContract"
text="<%=myBean.getAnsvh_Text()%>"
design="STANDARD"
/>
</hbj:formLayoutCell>
</hbj:formLayoutRow>
<hbj:formLayoutRow id="Row2" paddingTop="1px" paddingBottom="1px" >
<hbj:formLayoutCell id="Cell21" align="LEFT" width="40%" >
<hbj:label
id="label_HiringDate"
text="Hiring Date"
design="LABEL"
labelFor="HiringDate"></hbj:label>
</hbj:formLayoutCell>
<hbj:formLayoutCell id="Cell22" align="LEFT" width="40%" >
<hbj:textView
id="HiringDate"
text="<%=myBean.getEntry_Date()%>"
design="STANDARD"
/>
</hbj:formLayoutCell>
</hbj:formLayoutRow>
</hbj:formLayout>
</hbj:groupBody>
</hbj:group>
</hbj:gridLayoutCell>
</hbj:gridLayout>
</hbj:form>
</hbj:page>
</hbj:content>
******************* JAVA
package MSSPackage;
import MSSBeanPackage.HolderDetailBean;
import com.sapportals.htmlb.*;
import com.sapportals.htmlb.enum.*;
import com.sapportals.htmlb.event.*;
import com.sapportals.htmlb.page.DynPage;
import com.sapportals.htmlb.page.PageException;
import com.sapportals.portal.htmlb.page.JSPDynPage;
import com.sapportals.portal.htmlb.page.PageProcessorComponent;
import com.sapportals.portal.prt.component.IPortalComponentContext;
import com.sapportals.portal.prt.component.IPortalComponentProfile;
import com.sapportals.portal.prt.component.IPortalComponentRequest;
// SAP RFC Imports
import com.sap.mw.jco.IFunctionTemplate;
import com.sap.mw.jco.JCO;
import com.sap.mw.jco.JCO.Table;
import com.sapportals.portal.prt.service.jco.IJCOClientPoolEntry;
import com.sapportals.portal.prt.service.jco.IJCOClientService;
import com.sapportals.portal.prt.runtime.PortalRuntime;
public class HolderDetail extends PageProcessorComponent {
public DynPage getPage(){
return new HolderDetailDynPage();
public static class HolderDetailDynPage extends JSPDynPage{
JCO.Repository mRepository;
public void doInitialization(){
// Define request, context and profile containers
IPortalComponentRequest reqst = (IPortalComponentRequest) this.getRequest();
IPortalComponentContext myContext = reqst.getComponentContext();
IPortalComponentProfile myProfile = myContext.getProfile();
// Define bean reference to bean
HolderDetailBean myBean = new HolderDetailBean();
// Place bean in user profile.
myProfile.putValue("myBean", myBean);
public void doProcessAfterInput() throws PageException {
public void doProcessBeforeOutput() throws PageException {
// Define request, context and profile containers
IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
IPortalComponentContext myContext = request.getComponentContext();
IPortalComponentProfile myProfile = myContext.getProfile();
//Get Bean from Profile
HolderDetailBean myBean = (HolderDetailBean) myProfile.getValue("myBean");
String sapSystem = "SAP_R3_HumanResources";
// GET THE POSITION ID FROM THE URL QUERY STRING
String PosId;
PosId = request.getParameter("CKey");
//PosId = "60004790";
if (PosId == null)
myBean.testing = (String) request.getComponentSession().getValue("PosId");
else
PosId = PosId.substring(6, 14);
request.getComponentSession().putValue("PosId", PosId);
myBean.testing = "POSID:" + PosId;
this.setJspName("HolderDetailJSP.jsp");
Thanks for your thoughts. -
Web Module Creation in j2ee perspective and jsp dynpage
Hi all,
Can someone tell me when to use jsp via creation of web module using suspend and resume plugs and jsp dynpage. I am not clear with these two concepts. Basically I want to work with jsp's and tht too want to be able to view it in portal iview.
Regards,
Preetihi
check this out
/message/413811#413811 [original link is broken]
/message/864533#864533 [original link is broken]
/people/community.user/blog/2006/11/02/jspdynpage-with-client-side-eventing-and-database
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a08c287b-96a5-2a10-a691-b8b8bc40ea43 -
Accessing BAPIs in JSP Dynpage
Dear Experts,
I need to access BAPIs in my JSP Dynpage applications. As per my understanding, there are in two ways we can acheive this JCO and JCA. I would like to know the difference between these two methods ibased on performance.
Any pointers? Thanks for your help!
RamHi ,
Please take a look at the below links.
http://help.sap.com/saphelp_nw2004s/helpdata/en/f5/cfa441cd47a209e10000000a155106/frameset.htm
JCA
Hope these will help.
Thanks,
Sandip -
Hi all,
Can any one give me a sample code for using a java script in jsp dynpage which invokes on client click. I mean i want to call a java script function on client click.Hi,
Check these:
https://wiki.sdn.sap.com/wiki/display/Snippets/JSPDynPage-Howtohideanelementonclienteventingaswellaschangethetextofthebutton+dynamically
Search for onClientClick in above link and you will find the corresponding javascript function that is called when user clicks the button.
Regards,
Praveen Gudapati -
RE;Difference between webdynpro java and Jsp Dynpage and Dynpages
hi all,
What are the befinits of webdynpro when compared with other
Jsp Dynpage and Dynpage.Hi Mahesh,
Refer to the following links which gives you the good idea.
Choosing between Webdynpro and JspDynpage/Dynpage
JSPDynpage Vs Web Dynpro Java
/thread/65254 [original link is broken]
JSPDynpage Vs Web Dynpro Java
Thanks n Regards,
Jhansi Miryala -
Creation of Simple JSP DynPage program
Hi Experts,
Could you please send me some link to create simple JSP DynPage program.
Regards,
RKHi,
Check these..
http://help.sap.com/saphelp_nw2004s/helpdata/en/f5/cfa441cd47a209e10000000a155106/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/d0/d4a441cd47a209e10000000a155106/content.htm
https://www.sdn.sap.com/irj/sdn/thread?messageID=223649#223649
Regards,
Harini S
Maybe you are looking for
-
How do I get an email file attachment, any extension, off of my phone?
All I want to do is get an email file attachment off of my phone and on to my computer so I can use it. I don't want to open it on my phone, it could be an AutoCAD file, a programming langauge file, etc. I want the option to save the attachment to
-
I can not make Access repair database using built-in utility?
Access 2013 reports that the file is not a database, and the data in the file are displayed via NotePad. Function "Database Utilities | Compact and Repair Database" does not work.
-
Moving a vxvm volume from rg to local?
Hello, Is it possible in SC 3.0 to move a volume or disks including volumes to a "local" diskgroup? What steps have to be done? Do i have to move them to the rootdg or can i convert a dg to be "local", which means that the dg is brought online by Sol
-
Include constant String values in javadoc?
I just got tired of search/replace in JavaDoc parts and asked myself if the following is possible: (I use JSP Syntax for the part that I don't know if it's posible) public static String insert = "this ist the insert"; * Display here: <%=insert%> */An
-
I have created a project in Captivate 6. When I attempt to preview the project I get a white screen and the project does not display. But If I add a button to a slide the button will display but not the slide. Can anyone help me to troubleshoot this