[Installation, Configuration & Deployment] - Re: Configuration to remove key Server from HTTP header
by jijisv
Ya.. I removed that from the header. I want to remove the Server also.
I put a Valve in the request/reponse processing pipeline and tried to change value of the key Server. but wat i got is the key Server got added twice in the header.
HTTP/1.1 200 OK
| Server: Apache-Coyote/1.1
| Set-Cookie: JSESSIONID=BAEB56FBC19BEE1B1C5FECBBBEBA5C80; Path=/; Secure
|
| Stored cookie 192.168.3.156 443 / nonpermanent 1 Thu Jan 1 05:29:59 1970
| JSESSIONID BAEB56FBC19BEE1B1C5FECBBBEBA5C80
| Server: My Server
| Content-Type: text/html
| Content-Length: 0
| Date: Thu, 20 Jul 2006 08:25:34 GMT
| Connection: keep-alive
...and my Source code is
import javax.servlet.http.HttpServletResponse;
| import java.io.IOException;
| import javax.servlet.ServletException;
| import org.apache.catalina.connector.Request;
| import org.apache.catalina.connector.Response;
| import org.apache.commons.logging.Log;
| import org.apache.catalina.valves.ValveBase;
|
| public class KnHttpRequestFilterValve extends ValveBase {
|
| private static final String info = KnHttpRequestFilterValve.class.getName() + "/1.0";
|
| public String getInfo() {
| return info;
| }
|
| public void invoke(Request request, Response response)
| throws IOException, ServletException {
|
| Log log = container.getLogger();
| // process request
| log.debug("Processing Request...");
| processRequest(request, response);
|
| // call next valve
| getNext().invoke(request, response);
|
| // process response
| log.debug("Processing Responses...");
| processResponse(request, response);
| }
|
| private void processRequest(Request request, Response response)
| throws IOException, ServletException {
| }
|
| private void processResponse(Request request, Response response)
| throws IOException, ServletException {
|
| if (response instanceof HttpServletResponse) {
| ((HttpServletResponse)response).setHeader("Server", "My Server");
| }
| }
| }
|
... and the valve configuration is
<Host name="localhost"
| autoDeploy="false" deployOnStartup="false" deployXML="false">
|
| <Valve className="com.kodiak.wgp.container.util.KnHttpRequestFilterValve" />
| .......
| .......
I feel like the key Server is put in the last stage of response processing pipeline. Any idea to remove this ??
Thanks,
Jiji
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959432#3959432
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959432
19 years, 9 months
[JBossWS] - Strange java.lang.ClassCastException: org.jboss.axis.Message
by jwiesmann
Hi all,
i searched the whole forum, but i was not able to find a problem like this.
Maybe anybody can help me finding a solution.
I want to use a webservice to get some information from a iis server.
I am using jboss 4.0.2.
If i write a main method and just let my source run, everything works fine.
If i trie to do the same with jboss, i will get a class cast exception.
The error is the following:
My "local - console" class is:
org.apache.axis.Message
if i start the server, it uses:
org.jboss.axis.Message
and tries to set the message @ the apache.axis.MessageContext, which ends with a class cast exception.
If i replace jboss-saaj.jar and jboss-jarprc.jar with saaj.jar and jarpc.jar from apache.org it all works fine.
But i do not know what happends to the rest of my jboss installation, if i just replace those two jar files...
but just let some code show u what i mean:
in a console / eclipse (right click, run as java application)
| Service service = new Service();
| Call call = (Call) service.createCall();
| call.setPassword(password);
| call.setUsername(userName);
| call.setTargetEndpointAddress(new java.net.URL(endPointUrl)); System.out.println(call.getMessageContext()); // org.apache.axis.MessageContext System.out.println(msg.getClass().getName());// org.apache.axis.Message
| call.getMessageContext().setMessage(msg);
| call.invoke();
|
at my application server it looks like that:
| Service service = new Service();
| Call call = (Call) service.createCall();
| call.setPassword(password);
| call.setUsername(userName);
| call.setTargetEndpointAddress(new java.net.URL(endPointUrl)); System.out.println(call.getMessageContext());//org.apache.axis.MessageContext System.out.println(msg.getClass().getName());//org.jboss.axis.Message
| call.getMessageContext().setMessage(msg); // <-- classCastException
| call.invoke();
|
You see the differents ? It ones uses jboss and the othertime apache. Why is that so? I copied saaj.jar and jarpc.jar to my lib folder.
any idea or hints for me ?
Thx !
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959431#3959431
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959431
19 years, 9 months
[Installation, Configuration & Deployment] - Re: Windows Explorer automatically pops up displaying C:\Pro
by Markus.Wahl
"PeterJ" wrote : In Explorer, under Tools | Folder Options, in the View tab, is 'Restore previous folder windows at logon' checked?
No, it's not checked.
"PeterJ" wrote : ...that you are seeing an Explorer window opening at the JBoss home directory.
You are right, this is precisely the problem.
"PeterJ" wrote : It would help to have a more thorough description of the window in question (i.e., window title text, text within window, buttons displayed, etc.).
explorer window title: C:\Program
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959428#3959428
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959428
19 years, 9 months
[JBoss Seam] - Inject EL Results
by MSchmidke
Hello,
okok, perhaps my yesterday's post was a little bit confusing. I'll give it another try with totally other words.
In Facelets, you can use the ui:include tag to embed components, and you can use ui:param to pass arguments to that components. Inside the included component, the arguments are accessible via EL without any problem, but they are not injectable to seam components. So I suppose that there is some kind of local variable storage in Facelets, which is not accessible from Seam.
I can imagine several solutions for this:
- I am perfectly wrong and there is just a mistake I made somewhere
- Modify Seam so that it can access to that local variable storage
- Add a custom tag which allows to store an EL result in a context variable (so that I can copy them over to something which is visible for Seam)
- Add something else so that I can inject the result of an EL expression
What do you think?
Regards,
Marcus.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959425#3959425
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959425
19 years, 9 months
[JBoss Seam] - Re: @Begin and @End
by Holger Prause
"gavin.king(a)jboss.com" wrote : If you really _have_ to have transparent lazy fetching of data off of the user, combined with caching of that data then create a session-scoped managed persistence context.
|
| There are a couple of ways to do this, but the easiest is to use Seam 1.1 CVS build and throw the following in components.xml:
|
| <component name="userDatabase"
| | scope="session"
| | class="org.jboss.seam.core.ManagedPersistenceContext">
| | <property name="persistenceUnitJndiName">java:/myEntityManagerFactory</property>
| | </component>
| |
|
| Hello, i want to use the approache mentionend above but i have some questions regarding this.
|
| 1)
| What does "myEntityManagerFactory" means in this context, is that the value of the "jboss.entity.manager.factory.jndi.name" property described in my persistence.xml ?
|
|
| | <property name="persistenceUnitJndiName">java:/myEntityManagerFactory</property>
| |
|
| 2) how can i use this(java side)?
|
| Should i use
|
| @PersistenceContext
| private EntityManager em;
|
| or (adepting your example nr1)
|
| @In(create=true)
| private EntityManager userDatabase;
|
|
| Thank u very much,
|
| Holger
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959423#3959423
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959423
19 years, 9 months