简体   繁体   English

JSP / JSF转换为ASP.NET

[英]JSP/JSF conversion to ASP.NET

I have a pretty big JSF web application. 我有一个非常大的JSF Web应用程序。 I must convert the application to ASP.NET. 我必须将应用程序转换为ASP.NET。 I already converted the Java code to C# code manually and also using JCLA (Java Language Conversion Assistant from Microsoft). 我已经手动将Java代码转换为C#代码,并且还使用了JCLA(Microsoft的Java语言转换助手)。

What is the best way to convert the JSF part to ASP.NET? 将JSF部件转换为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... 例如,将JSF <t:dataList>转换为ASP.NET datagrid ,或将panelGroup转换为asp:panel等...

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 . 在这种情况下我要做的是手动转换一个组件,然后使用它作为使用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. 不是很快,但是你需要转换的越多,收益就越好,并且还有一个额外的好处,就是你可以定义你所包含的任何自定义组件的转换,这些组件在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. 我也没有在这个领域看过任何东西,所以我假设人们已经采用了手动路径并实现了自己的解决方案,或者只是使用以前的应用程序作为模板在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 查看页面的输出并再次执行步骤1和2,您可能会发现每次运行脚本的迭代,您都会找到其他可以编写的脚本,而您之前没有看到过

  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. 让你的转换器脚本/应用程序变得更加智能并生成标签/属性的报告并不难,但它没有考虑到,这可以反馈到第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 JSF - >脚本/应用程序 - >数据文件 - >模板系统( 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 HTH,随时提问

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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