Netbeans 5.5 Visual Web still not support for Java 5 source in Web Project?

This is really annoying. I would have thought by now that this would be allowed.
[87 byte] By [blackberet] at [2007-11-26 11:13:13]
# 1
Did you create a new project in VWP and select Java EE 5 as the platform type, or did you import an older Creator project over and expect it to support Java EE 5 from there?When you import a Creator project, it will import as a Java EE 1.4 project.
peppertech at 2007-7-7 3:27:48 > top of Java-index,Development Tools,Java Tools...
# 2

Is there a way to convert an existing Creator project to an EE 5 project?

I'm guessing it is probably possible to create a new EE 5 project and manually copy over all of the jsp/java files. But is there a better way?

Edit: I've been looking at a new EE 5 project and it looks like a lot of find/replacing would also be needed since it uses com.sun.webui instead of com.sun.rave, webuijsf instead of ui, etc. I would still think it is possible though... just with a little bit more work.

Message was edited by:

jsr

jsr at 2007-7-7 3:27:48 > top of Java-index,Development Tools,Java Tools...
# 3

As far as I know, there isn't a way to do this. It's not quite as easy as it sounds.

A Java EE 5 project will use the JSF 1.2 components. While the existing Creator project is using JSF 1.1 components. While many of them are the same, there are differences.

I have never tried the copy and paste of the source code myself. Might work. :-)

peppertech at 2007-7-7 3:27:48 > top of Java-index,Development Tools,Java Tools...
# 4

One big difference between the two project types are the imports:

Creator2 & VWP EE4 projects use:

com.sun.rave.web.ui.

eg.

com.sun.rave.web.ui.component.TextField;

VWP EE5 projects use

com.sun.webui.jsf.

eg.

com.sun.webui.jsf.component.TextField;

The project palettes look identical so if you ever get confused as to which project you are using do the following:

1. right click on the project node (projects window)

2. select properties

3. In the Project Properties dialog select the Run Category node.

Your Server and Jave EE Version will be displayed.

Hope it helps,

Lark

Creator Team

Lark at 2007-7-7 3:27:48 > top of Java-index,Development Tools,Java Tools...
# 5

I can't convert my current Java Studio Project over to use Java 5?

If so it means that the last year and a half that I've spent using and

promoting Creator will be thrown out the door because this tool will

have absolutely no compatibility with any new work that my project does.

I've been holding back a lot of people with the promise that we can do

Java 5 and JSF with Creator in the Netbeans release. Obviously this

has been a complete lie and as a result I will have to dump Creator and

move to Eclipse. The Eclipse editor, by the way, does support Java 5 and the WebUI components together.

blackberet at 2007-7-7 3:27:48 > top of Java-index,Development Tools,Java Tools...
# 6

If you're just interested in using the Java SE 5 features, there might be an easy way for the VWP. This does not work for JS Creator 2.1! The infrastructure does not support this.

But be aware that your target container has to run on at least the same Java SE version!

* Shut down the IDE.

* Change the source.version and target.version in your <project>/nbproject/project.properties to 1.5

* Open your project in the IDE again and now you should be able to use the new language constructs;-)

Thanks,

-- Marco

mw46 at 2007-7-7 3:27:48 > top of Java-index,Development Tools,Java Tools...
# 7
I forgot to mention, the VWP supports full Java SE 5 in Java EE 5 projects. But as others pointed out, it's not easy to convert existing projects!Thanks,-- Marco
mw46 at 2007-7-7 3:27:48 > top of Java-index,Development Tools,Java Tools...
# 8

Yes that does allow me to use Java 5 features in a Web project.

That's a relief.

Now continuing on with the conversion, has anyone attempted to migrate

their Creator project to JEE 5?

Will it only be changing

com.sun.rave.web.ui

to

com.sun.webui.jsf

I am expecting JSF 1.2 to be backwards compatible with JSF 1.1.

But is there something else that I'm missing that will make this conversion

very difficult?

blackberet at 2007-7-7 3:27:48 > top of Java-index,Development Tools,Java Tools...
# 9

I just converted a project this morning. It wasn't too difficult, it just took a little bit of time getting everything correct. There are a few more changes needed then just the imports. I used a program called rpl (available on windows and unix) to do the find and replacing that was needed. You could easily use sed or some other program to do the same thing.

Basically, here are the steps.

1. Create a new EE 5 project and make sure it has the same name and default java package.

2. Copy your existing .jsp files to the new web dir and existing .java files to the src directory.

3. Here are the changes I made to the .jsp files:

bash-2.03$ rpl 'xmlns:ui="http://www.sun.com/web/ui"' 'xmlns:webuijsf="http://www.sun.com/webui/webuijsf"' *

bash-2.03$ rpl 'ui:' 'webuijsf:' *

bash-2.03$ rpl 'action=' 'actionExpression=' *

bash-2.03$ rpl 'valueChangeListener' 'valueChangeListenerExpression' *

4. And here are the changes to the .java files. Note that there are still some usages of the com.sun.rave.web, so after converting

everything to com.sun.webui.jsf, I converts a few back to rave:

bash-2.03$ rpl 'com.sun.rave.web.ui' 'com.sun.webui.jsf' *

bash-2.03$ rpl 'com.sun.webui.jsf.appbase.AbstractPageBean' 'com.sun.rave.web.ui.appbase.AbstractPageBean' *

bash-2.03$ rpl 'com.sun.webui.jsf.appbase.AbstractSessionBean' 'com.sun.rave.web.ui.appbase.AbstractSessionBean' *

bash-2.03$ rpl 'com.sun.webui.jsf.appbase.AbstractApplicationBean' 'com.sun.rave.web.ui.appbase.AbstractApplicationBean' *

bash-2.03$ rpl 'com.sun.webui.jsf.appbase.AbstractRequestBean' 'com.sun.rave.web.ui.appbase.AbstractRequestBean' *

bash-2.03$ rpl 'com.sun.webui.jsf.appbase.AbstractFragmentBean' 'com.sun.rave.web.ui.appbase.AbstractFragmentBean' *

5. You might have to make more changes then this, but this is all I had to do. If you get errors, it is just a matter of figuring out where the error is and then creating a similar action on a new page and looking to see what the correct format is.

5. Look at your old web/WEB-INF/managed-beans.xml and copy everything between <faces-config> and </faces-config> to the new managed-beans.xml

6. Look at your old web/WEB-INF/navigation.xml and copy everything between <faces-config> and </faces-config> to the new navigation.xml

7. Look at your old web/WEB-INF/faces-config.xml and copy and changes you might have made to your new faces-config.xml

8. Look at your old web/WEB-INF/web.xml and copy and changes you might have made to your new web.xml

9. Look at your old web/WEB-INF/sun-web.xml and copy and changes you might have made to your new sun-web.xml

10. Have fun getting your database to work correctly. I have had difficulty getting datasources correct on both old and new projects in VWP, so this could be difficult or easy depending on your database and what you are trying to do. If you are using something like Java DB then you are probably going to have a much easier time then trying to use a third-party JDBC like I was trying to do (MS SQL 2005 JDBC 1.1).

-Jeff

http://www.ragtop.org

jsr at 2007-7-7 3:27:48 > top of Java-index,Development Tools,Java Tools...
# 10
Are you using this tool for production work right out of the chute?
pennstump at 2007-7-7 3:27:48 > top of Java-index,Development Tools,Java Tools...
# 11

I would really hope NOT.

The Visual Web Pack release is a Technology Preview. It is not final and will change over the next month. No one has ever said it's ready for production use. It isn't even what would be considered a full Beta product. Thus the use of Technology Preview instead of Beta in the description.

peppertech at 2007-7-7 3:27:48 > top of Java-index,Development Tools,Java Tools...
# 12

Thanks a lot Jeff!

Your project convertion tips really works and saves my time!

Only I could add to your post is validators conversion and autosubmit actions in jsp dir:

bash-2.03$ rpl 'validator=' 'validatorExpression=' *

bash-2.03$ rpl 'common_timeoutSubmitForm(this.form,' 'webuijsf.suntheme.common.timeoutSubmitForm(this.form,' *

Roman.

Message was edited by:

Rom@n

Rom@n at 2007-7-7 3:27:48 > top of Java-index,Development Tools,Java Tools...