Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » How import Netbean projects (JSP & Servlet)?(How import Netbean projects (JSP & Servlet)?)
How import Netbean projects (JSP & Servlet)? [message #534720] Thu, 20 May 2010 06:47 Go to next message
Phil Freihofner is currently offline Phil FreihofnerFriend
Messages: 47
Registered: May 2010
Member
I'm working with a book on JSP & Servlets that has example code. At this point, I can import and run examples that are WAR files. But I cannot figure out how to import examples that are Netbean projects.

I found a similar question posed here from 2006, in which the respondent said that the best option was probably to use Netbeans to create WAR files, and then import those.

I thought I'd ask again, since things might have changed since 2006. I'm hoping to avoid downloading, installing and configuring Netbeans just to make the WAR files. But if that's what it takes...
Re: How import Netbean projects (JSP & Servlet)? [message #534820 is a reply to message #534720] Thu, 20 May 2010 12:56 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 5/20/2010 12:47 AM, Phil Freihofner wrote:
> I'm working with a book on JSP & Servlets that has example code. At this
> point, I can import and run examples that are WAR files. But I cannot
> figure out how to import examples that are Netbean projects.
>
> I found a similar question posed here from 2006, in which the respondent
> said that the best option was probably to use Netbeans to create WAR
> files, and then import those.
>
> I thought I'd ask again, since things might have changed since 2006. I'm
> hoping to avoid downloading, installing and configuring Netbeans just to
> make the WAR files. But if that's what it takes...
>

It's been a couple of years since I last used NetBeans (so beware).

You almost certainly cannot use File -> Import to create a new Eclipse
Dynamic Web Tools (or any other) project from one created with NetBeans
because the Eclipse workspace files aren't there to support it.

However, you can easily create a brand-new Eclipse Dynamic Web Project
project and, after naming it, designate the root of the source code
directory contributing the source code.

You will have to pay attention to the naming of the web content
filesystem (the subdirectory that dominates WEB-INF): after clicking
Next a couple of times in the new project wizard, you'll have a chance
to change the name from WebContent (Eclipse's default) to whatever the
NetBeans project is using.

There may be some odds and ends in the NetBeans project that do not come
straight across quite the same way, but I doubt it. You will have to set
up libraries from scratch I assume (using Build Path -> Configure Build
Path -> Libraries).

(The remaining alternative is to create a new Eclipse Dynamic Web
Project, then populate it with NetBeans-created source files one at a time.)

I do something similar to what I suggest in a tutorial I recently threw
together on setting up the sample source code to Geary's and Horstmann's
Core JavaServer Faces book. See
http://www.javahotchocolate.com/tutorials/corejsf.html Their sample
code slipped very easily into Eclipse, but was not written for it.

Hope this helps,

Russ Bateman
Re: How import Netbean projects (JSP & Servlet)? [message #534957 is a reply to message #534820] Thu, 20 May 2010 19:18 Go to previous messageGo to next message
Phil Freihofner is currently offline Phil FreihofnerFriend
Messages: 47
Registered: May 2010
Member
Yes, I noticed that Netbeans uses "Web Pages" where Eclipse uses "WebContent".

I'll give your approach another try. The first attempts at this (create a new project from source) failed because I gave up when the various folders I designated did not "connect". But maybe it will work with the additional changes you recommend. I'm afraid I might not understand the layout well enough yet to do a file-by-file import. (The attempt will be a learning experience?)

Thanks for the reply, and I'll definitely check out the tutorials on javahotchocolate. Double thanks for writing the tutorial!
Re: How import Netbean projects (JSP & Servlet)? [message #535307 is a reply to message #534820] Sat, 22 May 2010 01:37 Go to previous message
Phil Freihofner is currently offline Phil FreihofnerFriend
Messages: 47
Registered: May 2010
Member
I was able to get a Netbeans example project from the Murach JSP book to work! I am in your debt!

One note for anyone following in my footsteps: when configuring the new workspace, I did NOT follow the steps involving installing and setting up the JSF technology from the "How to Set Up Eclipse for Web Application Development Russell Bateman." Also, skipped steps 8 and 12 in "How to Set Up Core JavaServer Faces Example Code in Eclipse."

Also, had a bit of a stumble, missing the followup steps after "Finish" (starting with step 14) in which we correct the errors generated by the need to rename the packages. I immediately jumped into trying to fix the project myself when I saw the package name errors, and then got stuck because I was not familiar with the "Project--Clean.." functionality. All is clearly explained in the tutorial if one just keep moving forward.

Many many thanks!

Previous Topic:WSDL Deploy function failled
Next Topic:Rendering problems in Web Page Editor
Goto Forum:
  


Current Time: Tue Apr 16 16:18:12 GMT 2024

Powered by FUDForum. Page generated in 0.31097 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top