Forums Register Login

Redirects in the JSP

+Pie Number of slices to send: Send
Hi,

I am running a jsp on websphere 6.1. The jsp has the image link which automatically redirects to the other domain. However if I load the JSP on the server, redirect doesn't work. If I put I put the code in plain html page it wors perfectly fine.

In this example if I open the image link https://c.xxx.com/ImageServer?oid=00D30000000MODz&id=01530000001J0HYAA0 it get redirects to
https://c.yyy.com/ImageServer?oid=00D30000000MODz&id=01530000001J0HYAA0 and image get loaded.
If I run the below html, it also loads the image with internal redirect to link on the domain c.yyy.com. However, when I put this code in JSP and run on the server, the redirect doesn't work and the image is broken. Can someone please advise why this doesn't work on server and what fix needs to be applied?



Thanks
+Pie Number of slices to send: Send
Do a View Source at the browser and compare the image link that works to the one that doesn't.
+Pie Number of slices to send: Send
Hi,
Thanks for your input. Actually I created the html from the view source of the jsp page. Jsp doesn't work but html.
+Pie Number of slices to send: Send
If they are identical, they will work identically.
+Pie Number of slices to send: Send
Ideally it should work identical.
When I open the html in the browser on my desktop. It redirect correctly. However, when I put the html on server and run it, it doesn't.
What could be the issue on the server that it is not allowing to redirect the image URL?
+Pie Number of slices to send: Send
It's hard to understand your wording, but do I understand that you are asking about some kind of redirect which is taking place on the server, and you are showing us some HTML which would therefore have nothing to do with that?

I ask because you seem to be talking about running HTML on the server -- I can't figure out what that means.
+Pie Number of slices to send: Send
1. The redirect is configured on the server for the link https://c.xxx.ImageServer?oid=00D30000000MODz&id=01530000001J0HYAA0 to https://c.yyy.ImageServer?oid=00D30000000MODz&id=01530000001J0HYAA0.
If I directly open the https://c.xxx.ImageServer?oid=00D30000000MODz&id=01530000001J0HYAA0 in browser it goes to later.
2. The links above are from different server than my websphere server I am running the html on.
I am expecting the html execute on my websphere server which contains the above link and should redirect to c.yyy.... as it redirects in bullet 1 above.

3. If I open the html locally (not on the server), the redirect works in html.

Does this explain the issue?
+Pie Number of slices to send: Send
 

Amit K Jain wrote:1. The redirect is configured on the server



Configured on the server? What does that mean?
+Pie Number of slices to send: Send
This is a third party link and not from the websphere server I am using. For some reason they wanted to change the domain from c.xxx to c.yyy. Somehow they managed to send the request from xxx to yyy. Due to this change, since my application has the link for 'xxx' and it is not redirecting as explained above, appearing as broken.
+Pie Number of slices to send: Send
 

Amit K Jain wrote:and it is not redirecting as explained above



Okay. If you want to get out of explaining by claiming you already did, that's fine. Good luck with your project.
+Pie Number of slices to send: Send
Hey, I am bit confused now. I am explaining everything and answering question to get the solution for my issue. This is midnight here still I am up to give the information you are asking for, just to get the resolution because it's MY need. What did make you think that I don't want to explain? If I don't explain the issue I will not get the right answer that I well aware off.

Just to avoid the repetition I said 'as explained above'. Sorry for any mis-understanding.


1. The redirect is configured on the server for the link https://c.xxx.ImageServer?oid=00D30000000MODz&id=01530000001J0HYAA0 to https://c.yyy.ImageServer?oid=00D30000000MODz&id=01530000001J0HYAA0.
If I directly open the https://c.xxx.ImageServer?oid=00D30000000MODz&id=01530000001J0HYAA0 in browser it goes to later.
2. The links above are from different server than my websphere server I am running the html on.
I am expecting the html execute on my websphere server which contains the above link and should redirect to c.yyy.... as it redirects in bullet 1 above.

3. If I open the html locally (not on the server), the redirect works in html.

+Pie Number of slices to send: Send
 

Paul Clapham wrote:

Amit K Jain wrote:1. The redirect is configured on the server



Configured on the server? What does that mean?



So I asked you this. And you responded by not answering it, but by copying your original post. Let me try asking it in a different way, then. Exactly what did you do to configure the redirect on your server? Hopefully if you answer that, it might go some way toward explaining what "configured on the server" actually means.
+Pie Number of slices to send: Send
These links are from third party environment (Salesforce). I do not have the control over it, hence I am really not aware of it.
+Pie Number of slices to send: Send
Okay. Then if you don't know what they did, and it's a problem, and you can't explain it to anybody, then the best approach would be to ask them to deal with the problem. Let's carry on with this one instead:

Amit K Jain wrote:3. If I open the html locally (not on the server), the redirect works in html.



That sounds like you're "opening the HTML on the server". What exactly does that mean? It sounds like you are signing on to the machine where the server is running and opening a browser. Is that right?
+Pie Number of slices to send: Send
It means I have a html on my desktop and I opened it in the browser as a file. It works i.e. the image link redirects correctly
e.g. d:\\page.html

Another scenario was I push the same html on the websphere server and run it, the image link doesn't redirect and hence appears as broken.
e.g http:\\localhost:9080\context\page.html
+Pie Number of slices to send: Send
If I read what you didn't write there... in the first case you loaded a page into a browser on your computer, which isn't the Websphere server. And in the second case you loaded a page into a browser on some other computer, which is the Websphere server.

And in the first case, a certain link worked correctly in that it connected to a particular server, which then asked for a redirect. Whereas in the second case, that link "didn't work". Either because it couldn't connect to that particular server, or that it didn't receive a redirect request from that server, or that it didn't handle the redirect request correctly, or that it couldn't connect to the server named in the redirect request.

So I don't see a problem here. Nobody is going to be using a browser on the actual Websphere server anyway, so its behaviour is immaterial.

However perhaps I guessed incorrectly at what you didn't write.
+Pie Number of slices to send: Send
 


Whereas in the second case, that link "didn't work". Either because it couldn't connect to that particular server, or that it didn't receive a redirect request from that server, or that it didn't handle the redirect request correctly, or that it couldn't connect to the server named in the redirect request.


Possibly the reason could be any of you listed.
I realized that the difference between working and non working scenario is the 'websphere server'

I was in the impression that I might be missing something on my server, hence posted the question here. If you can advise if there is any way we can make the server talking to third party instance so that redirect works will be helpful.
I will shoot this question to Salesforce too if they have to say anything on this.

Thanks
Amit
+Pie Number of slices to send: Send
 

Amit K Jain wrote:If you can advise if there is any way we can make the server talking to third party instance so that redirect works will be helpful.



I don't think there's any point. In real life nobody ever signs on to the machine with the server and runs a browser there, so if your links don't happen to work in just that scenario, it isn't worth fixing that.

Of course that's still under the assumption that signing on to the server machine and running a browser there is actually the scenario you're asking about. So far your description of the problem could be describing that scenario but it could also be describing a variety of other scenarios too. But you haven't ever given a precise description of the scenario you're talking about. Instead we just get vague phrases like "server talking to". And you haven't even responded to my guesses about what your scenario might be. So I think we are wasting our time here. You may continue to go on doing so if you like but I have run out of interest.
+Pie Number of slices to send: Send
Its my bad if I still could not explain the issue.
Just wanted to add on your recent comment: If I have deployed any web application on the server (here websphere), the web pages of that application can be accessed in the browser from any machine as long as the server is up and running. It is not necessary that I need to log in to the server, the application is deployed on. It's just a web application.

I gave you the sample link as http:\\localhost:9080\context\page.html because I am running the application on my local server which is built in my IDE. If I have to access this page from other machine, I may have to use the IP of my machine like http:\\<ip>\context\html.jsp.


Anyways, thank you for your time on this.

Regards
Amit
I'm still in control here. LOOK at this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1400 times.
Similar Threads
jQuery - add rows to table from AJAX response
Tomcat 5.5.26 Sessions getting replicated but not working via browser
the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is
Is my code running twice? JSP, java beans, db updates - strange happenings
trouble with remove item fro shopping cart
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 06:54:17.