[Beginners Corner] - Using file resources in web projects
by hlamprecht
Hi,
I'm currently playing a bit around with JBoss and testing some things. I have two source projects: One web project ("frontend") containing a couple of JSPs, project specific design and stuff like that. The other source project ("backend") implements some classes, which are used by the JSPs via a taglib. One of those classes is generating some JavaScript code. The backend is included into the frontend project as a JAR file.
This JavaScript code loads some icons and displays them. The problem I have is, where to put the icons so that they can be downloaded by the JavaScript. If I add them to the frontend project, they can for sure be obtained by the browser via URL. But they belong to the backend, as they are part of this application.
In the future, both projects might be developed by different people. And I don't want the frontend guys to bother with all resources needed for the backend. This should all be included in the JAR file.
Does anybody have a hint for me, how to achieve this?
Thanks, Heiner
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106264#4106264
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106264
18 years, 8 months
[Remoting] - Multiple problems with ServerInvokerServlet and HttpNamingCo
by martin ganserer
Hi experts of remoting!
My configuration is as follows:
I use JBOSS 4.2.2 GA (EJB3). A remote client (RCP) communicates with the server via the ServerInvokerServlet.
Basically everything works fine and the response time is very good.
Here an example how I connect to the server:
// Initialize initial context
| Hashtable env = new java.util.Hashtable();
|
| env.put(InitialContext.PROVIDER_URL, "http://myhost:8080/invoker/JNDIFactory");
| env.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.HttpNamingContextFactory");
| env.put(InitialContext.SECURITY_PRINCIPAL, "user");
| env.put(InitialContext.SECURITY_CREDENTIALS, "password");
| env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
|
| try
| {
| ctx = new InitialContext(env);
| }
| catch (NamingException e1)
| {
| e1.printStackTrace();
| }
|
| ctx.lookup(...)
Well, as I said it works basically. But I have some further demands, that I haven't been able to implement yet.
1. Security
The application I deploy on the server uses a simple log-in module, witch works great when I use RMI as transport protocol.
If I use http as transport I get an error message that the user name is null!
What do I have to configure to get this working?
2. Exeption handling
Due to a bug in JBOSS remoting I downloaded the latest version of remoting in order to catch remote exceptions on my client. The tutorials say that there is a client-side switch: NO_THROW_ON_ERROR.
Where do I have to set this command within my configuration?
3. Compression
I want to compress traffic between server and client. On the server side I use following configuration:
| <mbean code="org.jboss.remoting.transport.Connector"
| name="jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3">
| <depends>jboss.aop:service=AspectDeployer</depends>
| <attribute name="Configuration">
| <config>
| <invoker transport="servlet">
| <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
| <attribute name="serverBindPort">8080</attribute>
| <attribute name="path">servlet-invoker/ServerInvokerServlet</attribute>
| <attribute name="marshaller" isParam="true">org.jboss.remoting.marshal.compress.CompressingMarshaller</attribute>
| <attribute name="unmarshaller" isParam="true">org.jboss.remoting.marshal.compress.CompressingUnMarshaller</attribute>
| </invoker>
| <handlers>
| <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
| </handlers>
| </config>
| </attribute>
| </mbean>
At the moment I get an error message when I try this configuration on my server telling me that the header is not in GZIP-format.
What do I have to do here on my client to use compression successfully?
Thank you very much in advance!!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106261#4106261
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106261
18 years, 8 months