View . HTML with Vraptor. Is it possible?

Asked

Viewed 202 times

3

I am a student of Analysis and development of systems and I love programming, I studied the basics of Java and I am searching frameworks just to get a sense. How do I return an HTML page in a controller with Vrptor instead of JSP.

I’m doing some tests with REST and did not want to use JSP. With Spring boot, I could only return one String: return "index.html". With Vraptor I haven’t found a way yet. Is it possible? How?

2 answers

3

If you use the result.forwardTo("/minhapagina.html"); in the controller works, but it makes more sense for you to use JSP that allows you to create Java code within HTML, i.e., dynamic pages.

0

Yes, just use it result.redirectTo("/index.html"); or the result.forwardTo("/index.html"); in the same Controller, which will redirect to you, but as @haykou said, it would be more convenient to use JSP, but nothing prevents the use of HTML, php, or other extensions, as long as you treat this way in the Controller.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.