开发者

accessing the .java file from .jsp file in Eclipse

in eclipse IDE how can i access a java class from .jsp exactly like accessing a servlet from a jsp file ? in other word, what should i replace with question marks "????????"

<form name="myForm" action="???????????????" method="pos开发者_JS百科t">
</form>

when i run engine.java file from "mypackage" package tomcat application servers shows this address in the address bar.

http://localhost:8080/rouyesh/servlet/mypackage.engine

anybody can help please?


You'll need to use whatever the path relative to your current URL is, or the absolute path, just as you would with files. It might be prudent at this point to investigate a web framework, however, before you destroy your product with insanity :P.


If you just need to call the class from your JSP page, then just do it.

If you need to expose your class through an URL, the standard way to do so, is to enter through a servlet (exposed in the usual way) and call the class inside the servlet.

Your particular framework may provide such functionality out of the box. Read the documentation carefully.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜