cancel
Showing results for 
Search instead for 
Did you mean: 

Pls help! How to put JSP import statement...

Former Member
0 Kudos

Hi, I just created a simple iView JSP that imports htmlb classes and now I'd like to import my own java classes onto it. For example, in my other projects, my JSP's have <%@ page import="project28.practice.contextClass" %> on top of the page. I currently have a file called practice.jar

If I want to put this import statement into my simple iView JSP and use it, what would I have to do/configure?, do I have to transform it into a .par file? Or can I transport the jar file to the portal? Any changes on NetWeaver?

I am new to this so any detailed help or suggestions are greatly appreciated!

Thanks again,

Baggett

Accepted Solutions (1)

Accepted Solutions (1)

detlev_beutner
Active Contributor
0 Kudos

Hi Baggett,

yes, you will have to build a PAR and for this, you will have to define some portalapp.xml as deployment descriptor for the portal application.

All this is done more or less automatically when using NWDS as IDE and creating portal project out of it.

For a simple JSP, you can set set portal component type to JSP, see http://help.sap.com/saphelp_nw04/helpdata/en/16/d12c413894f823e10000000a155106/frameset.htm

If you want some real logic behind it, a combination of java classes and JSPs are advised, this is to use the concept of a JSPDynPage, see http://help.sap.com/saphelp_nw04/helpdata/en/95/cfa441cd47a209e10000000a155106/frameset.htm

Read around the links given, it will bring you further.

Hope it helps

Detlev

Former Member
0 Kudos

Hi Detlev, thank you for your response! I'd like to include more details of my situation right now: I have 2 projects on NetWeaver:

Project#1: Java Web application Project. (jar files, WEB-INF, WEB-INF/web.xml, JSP's...)

Project#2: Portal Application Project. (JSPDynPage, sap plugins, PORTAL-INF/portalapp.xml, JSP)

I'd want my JSP file in Project#2 to call some classes from the jar files of Project#1.

From my understanding, to do this I need to make a .par file out of Project #1 and then upload the par file to my SAP EP6.0 so that my future JSP's can import classes from it. Am I correct?

I am confused right now as to how to really do this. On Netweaver, I am getting a Error when I try to do: File --> New --> Project --> Portal Application --> Create a Portal Application Project > I then enterProject Name: TestProject28, Project root folder: c:\TestProject\webapps\project1

--> "ERROR: Invalid project description, Reason:An error has occured while trying to create the project structure"

If possible can you please provide detailed instructions on how to configure or build a par file out of my java web application stated above?

Thank you so much for your time and help!

Baggett

detlev_beutner
Active Contributor
0 Kudos

Hi Baggett,

I don't know where this " "ERROR: Invalid project description" comes from. Maybe the dir c:\TestProject\webapps\project1 already exists and there is some content NWDS does not allow?

Searching for this error on SDN brings some old threads where this error occured on NWDS 2.0.4 and 2.0.5, sometimes reinstalling has helped. On which version are you on?

> how to configure or build a par file

> out of my java web application

You can not really build a par out of a web application project. Think of it: A PAR is a portal application, where the portal(!) itself is a web application and the portal application will be deployed as part(!) of this web application, by the portals own deployment logic.

So you should create a new portal project (within an empty dir) and copy the classes you whish into the public part of the portal application.

Then you would deploy the PAR under some portal app name, for instance "com.baggett.imported.webapp" and set a SharingReference within your original Portal App to this portal app.

By this, you have access to these classes. Even if I'm unsure if this makes any sense, for a portal application should be an application...

Another possibility might be to create a service within your newly created portal app, so that you can access this service from your original portal app. Please, look into the dev doc for such things, because this is not possible to explain in few words.

Hope it helps

Detlev

Former Member
0 Kudos

Hi Detlev, thank you so much for your response! I will try to digest all of this and try to set up my machine and get back to you.

Thank you,

Baggett.

Answers (0)