Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2007

Tip: Looking for answers? Try searching our database.

URL in IFRAME

Thread view: 
Manish Hatwalne - 13 Sep 2007 08:43 GMT
Let's say I have a struts action at http://xyz.com/someAction.do and this
URL is referred from one IFRAME via "src" attribute of IFRAME. Is it
possible for me to detect inside someAction.do which page is embedding it in
an IFRAME? How can I do this?

et me put question in a different way, if I refer to Google API with this -

 code:
------------------------------------------------------------------------------

<script
src="http://maps.google.com/maps?file=api&v=2.x&key=ABQIAAAAHuQre3TX-ZKoHs97iqelnBQn0
9xNixTqt4LnUZ12n-xJURxIHRRdLvNa4xtUwCJO0gkyTjCSRjfctQ
"
type="text/javascript">
------------------------------------------------------------------------------

How does it know that the request is coming from domain xyz.com? It is not
purely based on the key - if I send same key from another domain, it doesn't
work! So how can I do that? Which header do I use? The referer header is
returned as null!

- manish
Andrew Thompson - 13 Sep 2007 10:12 GMT
>Let's say I have a struts action at http://xyz.com/someAction.do 

(all together now) "I have a struts action at http://xyz.com/someAction.do"

[ Sorry Manish, I just could not resist that silly pun.  ;-) ]

>..and this
>URL is referred from one IFRAME via "src" attribute of IFRAME. Is it
>possible for me to detect inside someAction.do which page is embedding it in
>an IFRAME? How can I do this?

Umm.. exactly the way you would do it in DHTML?

A thing most Java programmers seem very likely
to ignore is that web based apps. utlimately come
down to HTML and JS (and CSS).

So, to put that comment (hopefully) into some sort
of relevance to your question..

Try and produce this effect in pure HTML and JS,
consulting the appropriate HTML/JS news groups.
Assuming you can come up with a pure HTML/JS
solution, code that exact same HTML/JS in your
web. app., and everything should be sweet (work
as planned).

(That may sound like a dumb and sarcastic answer,
but it is not intended as such.)

Signature

Andrew Thompson
http://www.athompson.info/andrew/

Manish Hatwalne - 13 Sep 2007 11:18 GMT
>>Let's say I have a struts action at http://xyz.com/someAction.do
>
[quoted text clipped - 14 lines]
> to ignore is that web based apps. utlimately come
> down to HTML and JS (and CSS).

Not really!!!

window.location.href wouold give me URL of teh actual page containing this
form that I have vio struts action someAction.do (spare the pun)
But it is not possible for me to know which page is containing this action
"someAction.do" when my server recives a get request for this. Is there soe
HTTP header that I can check (referer is nulll in this case) and see that if
there was a page referring to this action in an IFRAME.

Any help/pointers on the headers???

- Manish


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.