• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need to access Java methods and javascript functions in a WAR file from another WAR

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having two WAR Files.

The first one contains a javascript and some utility Java methods along with the View Layer JSP.

Second one contains only the Web UI with some business logic for User Interface.

Both the WAR files are there in the same server.

I need to access the Java utility methods and javascript that is present in the first WAR from the second WAR file.

I cannot add the first WAR as a project reference in the second WAR and put it as a single WAR, as the requirement is strictly to deploy each WAR file separately

Can I use context path and access the Java Utility functions? is it possible to use the same method for getting the Javascript functions?

Can anyone suggest any method to access the Javascript functions and Java methods in the first WAR File?


Thanks,
Barani
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Doesn't look anything specific to JBoss. Servlets forum perhaps is a better place, but i don't understand what you mean by "need to access". What kind of access? You have want to refer to the java classes packaged in a different war file? If yes, then why not package those classes in a jar and then include them in both WAR1 and WAR2?

I'll let this thread stay here for sometime, because i am not sure where this one fits best.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Baranidharan Ramakoti wrote:I need to access the Java utility methods and javascript that is present in the first WAR from the second WAR file


This is not possible - code external to a WAR file cannot view anything within that WAR file (in your case, the first WAR cannot use anything that is in the second WAR).

You will have to do as Jaikiran suggests:

Jaikiran wrote: package those classes in a jar and then include them in both WAR1 and WAR2


 
reply
    Bookmark Topic Watch Topic
  • New Topic