[Microcontainer] - Re: Autoexplosion of archives
by bob.mcwhirter
I'm finding this difficult to get right...
If I use TEMP, it seems to just copy my archive into tmp/ as a single file.
If I use EXPLODE, it recursively explodes my archive, along with any .jar contained within. This upsets jruby, because it expects foo.jar to be a jarfile, not a directory.
If I use UNPACK, nothing happens. The UnpackCopyMechanism gives up at the root level, since it's testing if it's nested inside something else.
What I effectively want is just a top-level un-jarring.
as if I'd done
jar xvf myapp.rails
and deposited the results into tmp/myapp-tmp/...
My RailsStructure is creating a ContextInfo attached to the StructureContext, and setting the modification type upon it.
Should I instead be also creating a ContextInfo for each top-level child I want slurped out of my archive?
Thanks,
-Bob
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4193877#4193877
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4193877
17 years, 4 months
[Beginners Corner] - "HTTP Status 405: HTTP method GET is not supported by this U
by michael.rollins
I've been looking all over the web, and I keep coming up with the same solution, which is that you need to override doGet. Seems simple, right?
However, I am overriding doGet, and I've even taken the simple servlet down to an even simpler level, and I'm still getting a 405 error.
Briefly, I have created a web service that will return a PNG image as a byte array to the client. I created a simple client that receives the byte array. That client is called by a servlet. The servlet is supposed to write the byte array out to the browser.
Here's my servlet code:
| package org.casm.gadget.chart.client;
|
| import java.io.IOException;
|
| import javax.servlet.ServletException;
| import javax.servlet.ServletOutputStream;
| import javax.servlet.http.HttpServlet;
| import javax.servlet.http.HttpServletRequest;
| import javax.servlet.http.HttpServletResponse;
|
| /**
| * Servlet implementation class ChartClient
| */
| public class ChartClientServlet extends HttpServlet {
| private static final long serialVersionUID = 1L;
|
| /**
| * @see HttpServlet#HttpServlet()
| */
| public ChartClientServlet() {
| super();
| // TODO Auto-generated constructor stub
| }
|
| /**
| * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
| */
| protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
| super.doGet(request, response);
|
|
| try{
| ChartClient cc = new ChartClient();
| response.setContentType("image/png");
| ServletOutputStream out = response.getOutputStream();
|
| /*
| response.setContentType("text/html");
| PrintWriter out = response.getWriter();
| out.print("Hi");
| out.close();
| */
|
| out.write(cc.doTest());
| out.flush();
| out.close();
| }catch(Exception e){
| e.printStackTrace();
| }
|
| }
|
| /**
| * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
| */
| protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
| // TODO Auto-generated method stub
| super.doPost(request, response);
| doGet(request, response);
| }
|
| }
|
|
Everything up to writing the byte array out works. The web service is returning, and the byte array is getting passed to the servlet, but alas, only 405.
If you look in the doGet method, you can see where I tried another, simpler version where the servlet only prints "Hi". This also resulted in the 405 error.
I'm using JBoss 4.2.3.GA (the JDK6 version).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4193874#4193874
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4193874
17 years, 4 months