开发者

Whats the best way to pass values from an html page to a java class?

开发者 https://www.devze.com 2022-12-16 15:17 出处:网络
I have a project that needs to be changed.. right now i have a web page 开发者_如何学Gothat posts to a jsp that calls a servlet that calls a \"backend\" using Tomcat.

I have a project that needs to be changed.. right now i have a web page 开发者_如何学Gothat posts to a jsp that calls a servlet that calls a "backend" using Tomcat.

I need to get take Tomcat off the scene.

What i want is when i POST, it calls directly the "backend"

Any suggestions on how can i accomplished that?

Thanks Rev


Thus, you want to invoke a servlet class without using an servlet container like Tomcat?

You can't do that. Period.

If you elaborate in more detail why you need to do this (I really can't imagine of a legitimate reason by the way), we may give more suggestions how to solve/workaround the particular issue.

Update: since you tagged homework, is the reason maybe that you "accidently" created a JSP page and a Java class while your school doesn't have Tomcat running as sorta demo server, but just Apache+PHP or so instead? If so, then you'll really need to convert/translate to the suitable language. Don't waste time figuring ways to use JSP/Java without a Java Servlet Container at any way, there simply isn't a way. At least, not a "normal" way.


YOu need a servlet container to manage the logic that will allow you to accept a POST request.


You can't remove the servlet container if you want to use java.

Maybe you can rewrite the whole page in php and only use an apache web server ? You'll have to call directly you're DB or services. If you want to use your back-end application you'll have to keep tomcat.


If you are using servlet then you can not take tomcat off from the scene and you are telling you have a web page then you should need any servlet container. If you want tomcat off from the scene then you can go for **jetty or **resin****

0

精彩评论

暂无评论...
验证码 换一张
取 消