简体   繁体   中英

JSP/JSF conversion to ASP.NET

I have a pretty big JSF web application. I must convert the application to ASP.NET. I already converted the Java code to C# code manually and also using JCLA (Java Language Conversion Assistant from Microsoft).

What is the best way to convert the JSF part to ASP.NET? Is there any tool that can help shorten the work?

For example convert JSF <t:dataList> to ASP.NET datagrid , or converting panelGroup to asp:panel , etc...

I don't know of any off the shelf tools to do it.

What I'd do in this situation is convert one component manually and then use it as the basis for a code generation template using CodeSmith . Not quick, but the more you have to convert, the better the payoff and has the added benefit of letting you define conversions for any custom components you include that don't have direct analogs in ASP.NET.

Is this a once off conversion or part of a bigger project to migrate many apps?

I haven't seen anything in this area either, so I assume that people have taken the manual path and implemented their own solutions or just used the previous app as the template to create a similar structure in ASP.Net.

If I were you, I do something like:

  1. compare the similarities between the two and find as many common parts where you can do a conversion

  2. write a script/console app to go through and perform a basic conversion

  3. look at the output of the pages and perform steps 1 and 2 again, you'll probably find that with each iteration of running the script you'll find something else that you can script that you didn't see before

  4. it wouldn't be hard to make you converter script/app a little smarter and produce a report of the tags/attributes, that it found but you haven't accounted for and this can feed back into step 1.


The main idea is that you want to the script/app to do as much heavy lifting as possible and you do the tweaks at the end. You going to test every page anyway, so make individual page mods part of this testing process.

You also want to avoid getting into a situation where you spend more time writing the ultimate conversion script and tweaking every possible scenario where many of these scenarios aren't repeated.

The process could look something like:

JSF -> script/app -> Data file -> Template System ( CodeSmith ) -> ASP.Net

Let us know how you go, if you create a fairly generic script it might be of use to others wanting to do something similar down the track.

HTH, feel free to ask questions

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM