Existe algum comando JSP semelhante ao server.execute do ASP? Qual é?
Obrigado
Existe algum comando JSP semelhante ao server.execute do ASP? Qual é?
Obrigado
Da uma olhada na classe java.lang.Runtime
Esta é a documentação de Server.Execute. Ela é mais ou menos como um <jsp:include page=“scripts/login.jsp” /> do JSP.
Server.ExecuteThe Execute method calls an .asp file, and processes it as if it were part of the calling ASP script. The Execute method is similar to a procedure call in many programming languages.
Syntax
Server.Execute( Path)
Parameters
Path
A string specifying the location of the .asp file to execute. The Path parameter may be for either an absolute or a relative path. If Path is absolute, it must map to an ASP script in the same application as the calling .asp file. Path can be a string variable name that is set at run-time. The Path parameter must not contain a query string, or IIS returns an error.
Remarks
The Server.Execute method provides a way of dividing a complex application into individual modules. By employing the Server.Execute method, you can develop a library of .asp files that you can call as needed. This approach is an alternative to server-side include directives. The major difference is that you can dynamically call an .asp file by using Server.Execute.
After IIS processes the .asp file specified in the input parameter to Server.Execute, the response is returned to the calling ASP script.
The following collections and properties are available to the executed ASP page:
Application variables, even if they are set in the calling page.
Session properties, even if they are set in the calling page.
Server variables and properties, even if they are set in the calling page.
Request collections and properties, even if they are set in the calling page. This includes Form and QueryString data passed to the calling page.
Response collections and properties. The executed .asp file may modify HTTP headers. However, as with any .asp file, if the executed .asp file attempts to modify HTTP headers after it sends a response to the client, it generates an error.
If a file is included in the calling page by using #include, the executed .asp will not use it. For example, you may have a subroutine in a file that is included in your calling page, but the executed .asp will not recognize the subroutine name. You must include the file in each executed .asp that requires the subroutine.