cancel
Showing results for 
Search instead for 
Did you mean: 

JSP in NWDS

Former Member
0 Kudos

hi

i want to do a JSP application in NWDS

but there is some problem occurring

i will just brief u with the steps i have performed first

Click File->New->Project.

Select Portal Application from left side select Create a Portal Applicatoin Project from the right side,

click Next.

Name you project.

Click Finish.

If not already in the java perspective, click the little icon on the toolbar on the left hand side which has a "J" in it.

You should see your project in the package explorer.

Open the tree structure, you should see src.api, other stuff and a folder called dist. Open dist.

You should see all kinds of folders.

See the portalapp.xml file, this will be important later.

Put you .JSP files in the Pagelet folder and your images under the images folder.

No go back to the top. Uner the src.api folder, create a package.

Right-click > New> Package, name it(com.yourcompany.test).

Now right click the package and create your classes.

Rightclick -> New --> Other, select Portal Application on left and "Create a new Portal Application Object on right.

Click next, hightlight your project,

click next.

Open the Portal Component Node, select JSPDynpage,

Click next, Name the files...select API for location and click Finish.

after doing all this i m getting 2 errors stating

1> This compilation unit indirectly references the missing type javax.servlet.http.HttpServletRequest

(typically some required class file is referencing a type outside the classpath)

2> The project was not built since its classpath is incomplete. Cannot find the class file for javax.servlet.http.HttpServletRequest. Fix the classpath then try rebuilding this project.

how can i rectify these errors

useful answers will be rewarded

Regards

JM

Accepted Solutions (1)

Accepted Solutions (1)

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi John,

Try Add using External jars.

Ideally NWDS studio automatically adds these jars as a reference if the wizard is used.

Just a quick thought - have to tried to reorganize the imports?

Rightclick on the sourcecode and click on "Source" -> "Organize Imports"

This all doesnt help means you have to install NWDS again.

Regards, Suresh KB

Former Member
0 Kudos

thanks Abhimanyu and Radhika Kuthiala

i have added the files to my project as per your directions

but i m still facing the problem like

Warning The import com.sapportals.htmlb is never used

Warning The import com.sapportals.htmlb.enum is never used

Warning The import com.sapportals.htmlb.event is never used

i have imported

com.sap.portal.htmlb_api

\...\com..\default\lib\java\htmlb

prtapi.jar

htmlb.jar

htmlb_api.jar

useful answers will be rewarded

Regards

JM

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi John,

Rightclick on the sourcecode and click on "Source" -> "Organize Imports"

Regards, Suresh KB

Former Member
0 Kudos

hi

now i m facing more errors stating

Error PageProcessorComponent cannot be resolved or is not a valid

Error JSPDynPage cannot be resolved or is not a valid superclass

useful answers will be rewarded

Regards

JM

Former Member
0 Kudos

Hi ,,

Try to copy all the jars in to the

PORTALINF\dist\lib folder and try to compile

Swathi

Former Member
0 Kudos

Hi John,

Your project can be deployed .As these are just warnings and pointing towards the htmlb jar that has been included but not used.you can just remove the import statement from your .java code.It will work fine.

Regards

radhika Kuthiala

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi,

Did you added following jars?.

com.sap.portal.htmlbbridge.jar & prtapi.jar

Regards, Suresh KB

Former Member
0 Kudos

Thanks all the problem is solved

Regards

JM

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi John,

You can add the jars by right clicking on the project name->properties->java build path->addd external jars->browse till

•\SAP\IDE\IDE70\eclipse\plugins\com.sap.tc.ap_2.0.0\comp\SAP_JTECHS\DCs\sap.com\com.sapportals.htmlb\_comp\gen\default\public\default\lib\java\htmlb

•\SAP\IDE\IDE70\eclipse\plugins\com.sap.ep.applicationDevelopment_7.00\com.sap.portal.htmlb_api

Add both the jars.

In the created JSPDynpage .java file you can add

import com.sapportals.portal.htmlb.page.JSPDynPage;

import com.sapportals.htmlb.page.DynPage;

import com.sapportals.portal.prt.runtime.PortalRuntime;

It should remove the error.

Regards

Radhika Kuthiala

P.s You can award appropriate points for encouragement.:)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi John,

add prtapi.jar , htmlb_api.jar and htmlb.jar files to your project.

Regards

Abhimanyu L

Former Member
0 Kudos

Hi Abhimanyu Lagishetti

can you let me know how do i add these files to my project

useful answers will be rewarded

Regards

JM

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi John,

search for these files in your local system,

choose your project select properties from the context menu

choose Java Build Path

choosese libraries

choose add external jar files..

give the path to those .jar files.

Regards

Abhimanyu L

0 Kudos

Hi,

Follow the suggestions here, to set classpath to the required jar files:

Use class locator to find which classes exist in which jar files:

Greetings,

Praveen Gudapati

0 Kudos

Hi,

The classes reside in the servlet.jar. To be able to use the import, you should add this to your project's build path. You can use the predefined variable that comprises all J2EE standard libs - i.e. access the Properties of your project from the context menu, select Java Build Path -> select the Libraries tab -> press the Add Variable button. There should appear a variable called TSSAP_JAVAX_HOME. Select it, choose Extend button -> browse to lib/servlet.jar and add this to the list of referenced libraries.

This should work.

Greetings,

Praveen Gudapati

Former Member
0 Kudos

thanks Praveen Gudapati

those 2 errors are gone but now a chain of errors have come

The import com.sapportals.htmlb cannot be resolved

The import com.sapportals.htmlb cannot be resolved

The import com.sapportals.htmlb cannot be resolved

The import com.sapportals.htmlb cannot be resolved

The import com.sapportals.portal.htmlb cannot be resolved

PageProcessorComponent cannot be resolved or is not a valid superclass

can you help me to solve these errors also

useful answers will be rewarded

Regards

JM