Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

AEM SlingHttpServletResponse redirect external server

Avatar

Avatar
Validate 1
Level 3
Eric_Stricker
Level 3

Likes

12 likes

Total Posts

73 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 3
Eric_Stricker
Level 3

Likes

12 likes

Total Posts

73 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
Eric_Stricker
Level 3

02-06-2020

I have a simple servlet that upload a PDF to adobe esign and I manage to get a URL back. 

 

I now want to redirect the client to this URL. The actual URL is valid if I copy-paste it into a browser, but the AEM override the below URL from 

https://secure.na1.echosign.com/.....

to 

https://my.aem.server.url/.... ==> Error "Resource at '/public/apiesign' not found

 

How do i prevent this change in URL?

 

@component(service=Servlet.class,
property={
"sling.servlet.methods=" + HttpConstants.METHOD_GET,
"sling.servlet.paths="+ "/bin/test
})

@ServiceDescription("test")
public class test extends SlingAllMethodsServlet {

private static final Logger log = LoggerFactory.getLogger(test.class);

private static final long serialVersionUID = 1L;


@Override
protected void doGet(final SlingHttpServletRequest req,
final SlingHttpServletResponse resp) throws ServletException, IOException {
try {
.
.
.
.
.
String url = "https://secure.na1.echosign.com/public/apiesign?pid=CBFCI...U3in9aXcBSzz4pjulXWk14_14%2A&client_id=C...
log.info("Redirect url : " + url);
resp.setStatus(301);
resp.setHeader("Location", url);

} catch (Exception e) {
log.error("",e);
}
}
}

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 3
Eric_Stricker
Level 3

Likes

12 likes

Total Posts

73 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 3
Eric_Stricker
Level 3

Likes

12 likes

Total Posts

73 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
Eric_Stricker
Level 3

02-06-2020

Answer my own question.

 

We use an IIS URL rewrite between the internet and Author. We found that IIS is the one updating the URL. Not AEM.

 

Tested this by calling the server directly instead of using IIS URL Rewrite.

Answers (0)