Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Reading weblogic.xml properties

Posted on 2005-05-05
3
Medium Priority
?
2,419 Views
Last Modified: 2013-12-10

We're using weblogic 8.1 sp3.  In our weblogic.xml we have something like this:

  </session-descriptor>
    <session-param>
      <param-name>CookieName</param-name>
      <param-value>EBKLXQ</param-value>
    </session-param>
  </session-descriptor>

How do we get the name/value parid for CookieName in a Java servlet?

Thx.

jkabx
0
Comment
Question by:jkavx
3 Comments
 

Author Comment

by:jkavx
ID: 13941195

Sorry.  How do we get the name/value pair for CookieName in a Java servlet?
0
 
LVL 13

Accepted Solution

by:
petmagdy earned 375 total points
ID: 13941810
yes u can use a code like this:

          System.out.println("/WEB-INF/weblogic.xml");
          ServletContext serv = this.getServlet().getServletContext();
          InputStream inputStream = getServlet().getServletContext().getResourceAsStream("/WEB-INF/weblogic.xml");
          System.out.println("/WEB-INF/weblogic.xml");

          System.out.println(inputStream.available());
       //   System.out.println(url.getFile());
          BufferedInputStream bufferedInput;
          bufferedInput = new BufferedInputStream(inputStream);
          byte[] buffer = new byte[bufferedInput.available()];
          bufferedInput.read(buffer);
          System.out.println(buffer.length);
          String str = new String(buffer);
          System.out.println(str);


and with any xml parser u can get the value u want

Cheers
0
 
LVL 10

Expert Comment

by:ECollin
ID: 13943337
hi,

following a little code sample to see how to retreive cookies from a servlet


Cookie[] cookies = request.getCookies();

for(int i=0; i<cookies.length; i++) {
      Cookie cookie = cookies[i];
      String name = cookie.getName();
      String value = cookie.getValue();
       ...
    }


Emmanuel
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question