Jump to content
We've recently updated our Privacy Statement, available here ×

Determine HTTP/HTTPS protocol at runtime?


james.perry
Go to solution Solved by james.perry,

Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Solution

Create a parameter called something like PROTOCOL and drop this expression in it.

$P{JASPER_REPORT}.getProperty("ireport.jasperserver.url" ).split( ":" )[0]

This will give you either HTTP or HTTPS depending on how the user is accessing the platform.

Then alter any hardcoded URLs to include $P{PROTOCOL}.

e.g.  <![CDATA[$P{PROTOCOL}://localhost:8080/blah/blah/blah]]'

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...