cancel
Showing results for 
Search instead for 
Did you mean: 

how use .getServerName() and .getProtocoll() Method

Former Member
0 Kudos

Hello,

i have an easy question, but i cant solve it.

For an iView i need the Server name and Protokoll. Normaly(in JSP) in i would use the implicit request object for it.

But in the Javadoc i found this:

getServletRequest

public javax.servlet.http.HttpServletRequest getServletRequest()Gets the actual servlet request. Note: It is recommended not to access the servlet request if possible.

Returns:

The actual servlet request

When it is not recommended i think i better didnt do it. What is a nice way to get the webservers name and the protocoll in an iView?

Best Regards,

Patrick

Accepted Solutions (0)

Answers (1)

Answers (1)

Oliver_S
Product and Topic Expert
Product and Topic Expert
0 Kudos

I think its no problem to access the ServletRequest and pull information out it. But you shouldnt change it, because this would also affect other Portal Components.

The corresponding Portal Object is ComponentRequest like in nearly all PDK samples shown. It contains some aditional information from the portal runtime.

thats all.

Oliver

Former Member
0 Kudos

Hi Oliver,

thanks for the Answer. I ask this because the Object from IPortalComponentRequest has no getServerName method. But when it is not problem to read from the "normal" request object i do it this way.

Best Regards,

Patick