• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sharing of resources like html / jsp out of web application

 
vijay dadhwal
Ranch Hand
Posts: 47
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,

my name is vijay dadhwal
i have registered today at javaranch.com

i have a question.

From my webapplication, how do we access html / jsp pages from the domain which are not running under any servlet engine.

regards
vj
[ December 02, 2008: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64964
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't. A servlet engine is required to process servlets and JSP pages.
 
Richard Corbin
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I know what you mean, I'm doing the same thing. You have an HTML file thats used as an internal resource to be distributed with the bundle and you wish to pre/app-end this content to a servlet's output stream?

If thats the case the next question is are you just reading or are you in need of filelocks for synchronized writing? If you are just reading, you would use standard file reading procedures. Do this in a servlet that you initialize on startup, store it in a public static String in a global resources class/enum and you wont have to read anything again throughout the life cycle of the app.

If you need reads and writes on *file* in a specific order (gulp)

public writefile(String FileName, String content){
!isLocked ? call method below
}

private synchronized String SetFileContents(String FileName, String content) {
lock file access,
update file revision id,
re-buffer to global variable/store,
unlock
}

I highlight file because you can, to an extent do the same thing with the String Buffer you cached without syncing your app.
 
Laxman Jadi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use c:import to locate resource.
 
vijay dadhwal
Ranch Hand
Posts: 47
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I really appreciate your prompt reply for this thread.

just making my earlier question more precise with example.
domain-1 say, A.com is running web application under say tomcat
domain-2 say, B.com is running as website under IIS
now b.com contains many html files which needs to be published as footer by domain A.com's JSP pages.

As i know by default JSP can use jsp:include file = "url" to call other html files but it has it's own contraints :-

(1) Domain name cannot be part of url
(2) Context root of the URL should be visible to the calling JSP.

How do i make the context root of the IIS based B.com website visible to A.com ? so that i can use the resources atleast static HTML pages of B.com on my will.

Regards
vj
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64964
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best place to do this sharing is at build time, not at run time.

A single copy of the shared file can be stored in a source-control repository, but propagated to all web apps that need it when the war files are being built.
 
vijay dadhwal
Ranch Hand
Posts: 47
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic