Re: Wrong version 48.0, should be 47.0?

2003-01-26 Thread Sven Bischoff
tomcat seems to use a 1.3-compiler with the 1.4-runtime classes. with jdk1.4 the 
version of the generated classes has changed from 47.0 to 48.0  (i guess due to 
the "assert" keyword). make sure your JAVA_HOME environment variable points to 
the new jdk.

sven

Joe Latty wrote:
Has anyone come up against this error whilst trying to compile a jsp:

Generated servlet error:
bad class file: C:\j2sdk1.4.1\jre\lib\rt.jar(java/lang/Object.class)
class file has wrong version 48.0, should be 47.0
Please remove or make sure it appears in the correct subdirectory of the
classpath.

I am running j2sdk1.4.1, with Tomcat 4.1.12 and struts 1.1b3 ( I just
upgraded my jdk from 1.3).

All had been running well until I upgraded my jdk.


Thanks for any help.

Joe




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: problem streaming file to browser

2002-12-27 Thread Sven Bischoff

if you generate the response yourself, you should return null in your 
ReportAction.

sven

Srinivas Sampige wrote:
Hi
 Thanks for your reply.The code you have supplied is on the lines of what I am 
doing. Here is what happens. First time the action is run the PDF comes out 
fine to the nrowser but with this message on the server side -

2002-12-27 15:39:46 - Ctx( /etrac ): IllegalStateException in: R( /etrac + 
/reportAction.do + null) Cannot forward as OutputStream or Writer has already 
been obtained

   Then I cannot generate the PDF again until I execute another action by say 
... doing back to the main menu of my web app(through another action) OR say 
by logging out. I get the same "IllegalStateException" error in another simple 
test Action that I put together. Can somebody help me? The same thing works 
fine in as servlet. So, I am not able to understand what is special about a 
Struts Action! Should I be doing something else?. Here are snippets of my 
code-

public abstract class EtracAction extends EtacAction
{
   public ActionForward perform(ActionMapping mapping,ActionForm form 
,HttpServletRequest request, HttpServletResponse response) throws IOException,
  ServletException
{
   
   
   return performAction(mapping, form, request, response,userSessionInfo);
 
}

public abstract ActionForward performAction(ActionMapping mapping, ActionForm 
form, HttpServletRequest request, HttpServletResponse response, 
UserSessionInfo userSessionInfo) throws IOException, ServletException;

}//end of EtracAction



---
ReportAction extends EtracAction 
{
  public org.apache.struts.action.ActionForward performAction   
(org.apache.struts.action.ActionMapping mapping, 
org.apache.struts.action.ActionForm form, 
javax.servlet.http.HttpServletRequest request, 
javax.servlet.http.HttpServletResponse response, UserSessionInfo 
userSessionInfo)
throws javax.servlet.ServletException, java.io.IOException
 {

 byte[] reportBuffer = reportManager.generateReport(userSessionInfo);
 String fileName = "";
 //write the pdf to the response
 if (reportBuffer != null)
 {
 response.setContentType("application/pdf");
 response.setHeader("Window-target","report_window");
 fileName = "etracPdfReport.pdf";
 ServletOutputStream sout = response.getOutputStream(); //THIS IS THE CODE 
THAT FAILS THE SECOND TIME AROUND,HAVE TO EXECUTE ANOTHER ACTION BEFORE 
ANOTHER PDF CAN BE STREAMED BACK TO BROWSER.
 sout.write(reportBuffer);

 //sout.flush();  //tried these two lines to avoid above error
 //sout.close();  //but no improvement.

 }
 return mapping.findForward(Forwards.REPORT_PAGE);
 }//end of performaction
}//end of ReportAction



thanks in advance

Srinivas


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: working with resource.properties files in JSTL & Struts

2002-11-08 Thread Sven Bischoff
just place a context-param element in your web.xml as a child of .



 javax.servlet.jsp.jstl.fmt.localizationContext
 ApplicationResources


Sven


Anthony Mutiso 2 wrote:

What is recognized way to get JSTL  tag to share the same
resources bundle as Struts  tag?

Thanks

Anthony

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: html:options ordering

2002-10-30 Thread Sven Bischoff
Dennis Muhlestein wrote:


I have a hashtable with key/value that get displayed by an html:options
tag. 
Works ok, but they are ordered in reverse order of the id.  That isn't
any performance problem, but it looks a little strange to the user.

For instance, what if you wanted the options in alphabetical order?  In
my case, I need them ordered by the key for each options.


if you're using jdk1.4, try java.util.LinkedHashMap which preserves 
insertion-order.


-Dennis


Sven


--
To unsubscribe, e-mail:   
For additional commands, e-mail: