JAI + JSP

Hello.
I want to get the height of a image in a jsp with jai, but I am always getting:
javax.servlet.ServletException
     org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
     org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
     org.apache.jsp.imp_jsp._jspService(imp_jsp.java:244)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)my code is:
<%@page import= "javax.media.jai.JAI"%>
<%@page import= "java.awt.image.RenderedImage"%>
<%@page import= "java.net.URL"%>
<%@page import= "javax.media.jai.JAI"%>
URL url = new URL("http://images.amazon.com/images/P/B0009XTX5G.01.LZZZZZZZ.jpg");               
RenderedImage image = JAI.create("url", url);Thanks

Hello,
I had the same problem few months ago ( in that case i used Jimi instead of JAI).
The answer to your question is: use the java class called "Image".
Infact you can use JAI just for load or save to disk your image that you have to resize and then use the following code to resize the image :
Image imgResized = img.getScaledInstance(100,1,Image.SCALE_AREA_AVERAGING);
The object "img" is the image to resize and the object "imgResized" is the image resized with width equals to 100 and with a right height.
I used Jimi just to save my image and i think that with JAI there is a method to do this.
You can use JAI to load in memory your image too so you can avoid problem with MediaTraker class.
I hope that this can help you.
Cheers.
Stefano

Similar Messages

  • How to resize image in JSP using JAI ??!!

    Please help me how to resize an JPEG image from my JSP, could I use JAI lib ? how ?

    Hello,
    I had the same problem few months ago ( in that case i used Jimi instead of JAI).
    The answer to your question is: use the java class called "Image".
    Infact you can use JAI just for load or save to disk your image that you have to resize and then use the following code to resize the image :
    Image imgResized = img.getScaledInstance(100,1,Image.SCALE_AREA_AVERAGING);
    The object "img" is the image to resize and the object "imgResized" is the image resized with width equals to 100 and with a right height.
    I used Jimi just to save my image and i think that with JAI there is a method to do this.
    You can use JAI to load in memory your image too so you can avoid problem with MediaTraker class.
    I hope that this can help you.
    Cheers.
    Stefano

  • How to pass the javascript variable value to a jsp

    Hi
    I am trying to set a javascript variable with onClick event of a radio button in jsp
    and I am assigning this variable to a hidden property in JSP whic has the corresponding getter an setter method in form.
    But I am not able to retrtieve the value assigned in either form/action .can any body help me in this:
    The code is
    <script language="javascript">
    var jais="";
         function setValue(val)
              jais=val;
         document.o.value=jais;
    </script>
         <html:hidden property="o" value=""/>
    <input type=radio name="1"
                                            value="xyz"
                                                                          onclick="setValue('XYZ')" >
                                            ABC                                        
    and in the correspoding form bean I have
    private String o_val =null;
    public String geto()
    return o_val;
    public void seto(String strs)
    o_val=strs;
    In the action I am trying to access
    by
    1)String j=((form name)form.geto();
    2)String j=request.getParameter("o")
    but with both of them I am getting the value null
    Thanks in Advance

    You need to set the value of the hidden field in your function.
    Setting an unrelated variable will not help.
    function setValue(val)
    document.forms[0].o.value = val;
    also your get/set methods should be getO() and setO().

  • Recurring JVM Crash related to jai.RasterAccessor?

    We are having an intermittent problem with our JVM crashing and CF restarting on an almost daily basis. We are running CF                                      8,0,1,195765 in a Windows environment with JDK 1.6.0_04. The dump is below. Every time that this occurs, the "current compiletask" is the same (as listed below). Our JVM settings are also as follows with 1GB of Heap Space allocated:
    -server -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:PermSize=128m -XX:NewSize=256m -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC -XX:SurvivorRatio=4 -XX:+UseParNewGC -XX:+HeapDumpOnOutOfMemoryError -Dcoldfusion.rootDir={application.home}/../ -Dcoldfusion.libPath={application.home}/../lib
    I'm not sure if upgrading our JDK will help solve this problem but I'm thinking that there is some code somewhere that is calling the javax.media.jai.RasterAccessor java method and that is the root of this problem. I do not know what code might be calling this Java method but I was thinking that it might be related to CFDocument or CFImage. However, our use of these tags is pretty minimal.
    Here is the dump:
    # An unexpected error has been detected by Java Runtime Environment:
    # java.lang.OutOfMemoryError: requested 67108872 bytes for Chunk::new. Out of swap space?
    #  Internal Error (allocation.cpp:218), pid=6044, tid=4680
    #  Error: Chunk::new
    # Java VM: Java HotSpot(TM) Server VM (10.0-b19 mixed mode windows-x86)
    # If you would like to submit a bug report, please visit:
    #   http://java.sun.com/webapps/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    ---------------  T H R E A D  ---------------
    Current thread (0x52624000):  JavaThread "CompilerThread0" daemon [_thread_in_native, id=4680, stack(0x52d40000,0x52e40000)]
    Stack: [0x52d40000,0x52e40000]
    [error occurred during error reporting (printing stack bounds), id 0x80000001]
    Current CompileTask:
    C2:1459      javax.media.jai.RasterAccessor.<init>(Ljava/awt/image/Raster;Ljava/awt/Rectangle;Ljavax/m edia/jai/RasterFormatTag;Ljava/awt/image/ColorModel;)V (3287 bytes)
    ---------------  P R O C E S S  ---------------
    Java Threads: ( => current thread )
      0x533fe800 JavaThread "jrpp-199" [_thread_in_native, id=3200, stack(0x5cec0000,0x5cfc0000)]
      0x53270400 JavaThread "jrpp-198" [_thread_in_native, id=4460, stack(0x5a6a0000,0x5a7a0000)]
      0x53270800 JavaThread "jrpp-197" [_thread_in_native, id=6048, stack(0x5f160000,0x5f260000)]
      0x533cb800 JavaThread "jrpp-191" [_thread_in_native, id=1136, stack(0x5ada0000,0x5aea0000)]
      0x593cbc00 JavaThread "jrpp-189" [_thread_in_native, id=3960, stack(0x5fee0000,0x5ffe0000)]
      0x569f4400 JavaThread "jrpp-185" [_thread_in_native, id=4180, stack(0x67960000,0x67a60000)]
      0x56f52800 JavaThread "FusionReactor FD/R Remote Data Collector for {coldfusion.cfmx8.web1}" [_thread_blocked, id=4824, stack(0x5aba0000,0x5aca0000)]
      0x56f52400 JavaThread "FusionReactor Enterprise Service - Local Metrics Cache" [_thread_blocked, id=6076, stack(0x53650000,0x53750000)]
      0x59815800 JavaThread "Timer-16" [_thread_blocked, id=4684, stack(0x67160000,0x67260000)]
      0x53e75800 JavaThread "Timer-15" [_thread_blocked, id=2416, stack(0x66e60000,0x66f60000)]
      0x602dec00 JavaThread "FusionReactor Web Server (Server Thread Pool Member Thread-98)" [_thread_in_native, id=1644, stack(0x67060000,0x67160000)]
      0x602de800 JavaThread "FusionReactor Web Server (Server Thread Pool Member Thread-97)" [_thread_blocked, id=4172, stack(0x66f60000,0x67060000)]
      0x610e8400 JavaThread "FusionReactor Web Server (Server Thread Pool Member Thread-96)" [_thread_blocked, id=3148, stack(0x66d60000,0x66e60000)]
      0x5a364400 JavaThread "FusionReactor Web Server (Server Thread Pool Member Thread-95)" [_thread_in_native, id=2252, stack(0x66c60000,0x66d60000)]
      0x61676400 JavaThread "FusionReactor Web Server (Server Thread Pool Member Thread-94)" [_thread_blocked, id=5792, stack(0x66b60000,0x66c60000)]
      0x611e0400 JavaThread "FusionReactor Web Server (Server Thread Pool Member Thread-93)" [_thread_in_native, id=3492, stack(0x66a60000,0x66b60000)]
      0x56d12800 JavaThread "FusionReactor Web Server (Server Thread Pool Member Thread-92)" [_thread_in_native, id=5244, stack(0x66960000,0x66a60000)]
      0x5875d400 JavaThread "FusionReactor Web Server (Server Thread Pool Member Thread-91)" [_thread_blocked, id=4364, stack(0x66860000,0x66960000)]
      0x60a0a400 JavaThread "FusionReactor Web Server (Server Thread Pool Member Thread-90)" [_thread_blocked, id=976, stack(0x5fae0000,0x5fbe0000)]
      0x595b8400 JavaThread "FusionReactor Web Server (Server Thread Pool Member Thread-89)" [_thread_blocked, id=4944, stack(0x5d5c0000,0x5d6c0000)]
      0x60775800 JavaThread "FusionReactor Web Server (Server Thread Pool Member Thread-88)" [_thread_in_native, id=5832, stack(0x5fde0000,0x5fee0000)]
      0x6077d400 JavaThread "FusionReactor Web Server (Server Thread Pool Member Thread-87)" [_thread_blocked, id=3384, stack(0x5fce0000,0x5fde0000)]
      0x53193800 JavaThread "FusionReactor Web Server (Server Thread Pool Member Thread-86)" [_thread_blocked, id=2440, stack(0x5fbe0000,0x5fce0000)]
      0x531cc800 JavaThread "Timer-10" [_thread_blocked, id=5060, stack(0x5d4c0000,0x5d5c0000)]
      0x58e8f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=4864, stack(0x5e0d0000,0x5e1d0000)]
      0x584c8c00 JavaThread "scheduler-3" [_thread_blocked, id=2092, stack(0x5d3c0000,0x5d4c0000)]
      0x595f5400 JavaThread "scheduler-21" [_thread_blocked, id=3396, stack(0x57cb0000,0x57db0000)]
      0x53c3c800 JavaThread "scheduler-2" [_thread_blocked, id=744, stack(0x5c2c0000,0x5c3c0000)]
      0x56838800 JavaThread "SocketTimeout" daemon [_thread_blocked, id=3072, stack(0x5cfc0000,0x5d0c0000)]
      0x5921fc00 JavaThread "scheduler-1" [_thread_blocked, id=3476, stack(0x5cdc0000,0x5cec0000)]
      0x569b8800 JavaThread "MulticastListener" [_thread_in_native, id=5332, stack(0x5ccc0000,0x5cdc0000)]
      0x56b81800 JavaThread "MulticastListener" [_thread_in_native, id=5272, stack(0x5cbc0000,0x5ccc0000)]
      0x5273d800 JavaThread "MulticastListener" [_thread_in_native, id=2376, stack(0x5cac0000,0x5cbc0000)]
      0x58a63c00 JavaThread "MulticastListener" [_thread_in_native, id=1128, stack(0x5c9c0000,0x5cac0000)]
      0x56a81800 JavaThread "MulticastListener" [_thread_in_native, id=924, stack(0x5c8c0000,0x5c9c0000)]
      0x53212400 JavaThread "MulticastListener" [_thread_in_native, id=5140, stack(0x5c7c0000,0x5c8c0000)]
      0x5681bc00 JavaThread "MulticastListener" [_thread_in_native, id=4380, stack(0x5c6c0000,0x5c7c0000)]
      0x591ffc00 JavaThread "MulticastListener" [_thread_in_native, id=5420, stack(0x5c5c0000,0x5c6c0000)]
      0x59227c00 JavaThread "MulticastListener" [_thread_in_native, id=5616, stack(0x5c4c0000,0x5c5c0000)]
      0x53a18400 JavaThread "MulticastListener" [_thread_in_native, id=988, stack(0x5c3c0000,0x5c4c0000)]
      0x003f6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=620, stack(0x00030000,0x00130000)]
      0x5702ec00 JavaThread "Timer-9" [_thread_blocked, id=5580, stack(0x5b8a0000,0x5b9a0000)]
      0x585db800 JavaThread "Timer-8" [_thread_blocked, id=2556, stack(0x5b7a0000,0x5b8a0000)]
      0x53241c00 JavaThread "Timer-7" daemon [_thread_blocked, id=3184, stack(0x5b6a0000,0x5b7a0000)]
      0x567eb400 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=460, stack(0x5c1a0000,0x5c2a0000)]
      0x53980400 JavaThread "worker #4" daemon [_thread_blocked, id=5496, stack(0x5c0a0000,0x5c1a0000)]
      0x56e48c00 JavaThread "worker #3" daemon [_thread_blocked, id=2304, stack(0x5bfa0000,0x5c0a0000)]
      0x53a04c00 JavaThread "worker #2" daemon [_thread_blocked, id=4248, stack(0x5bea0000,0x5bfa0000)]
      0x53c63800 JavaThread "worker #1" daemon [_thread_blocked, id=3488, stack(0x5bda0000,0x5bea0000)]
      0x58a64400 JavaThread "worker #0" daemon [_thread_blocked, id=192, stack(0x5bca0000,0x5bda0000)]
      0x56a1d400 JavaThread "ServerThread" daemon [_thread_in_native, id=1920, stack(0x5bba0000,0x5bca0000)]
      0x588b9400 JavaThread "Thread-26" [_thread_blocked, id=4456, stack(0x5baa0000,0x5bba0000)]
      0x56a72400 JavaThread "Thread-22" [_thread_in_native, id=3872, stack(0x5b5a0000,0x5b6a0000)]
      0x53aaf800 JavaThread "obj-skimmer" daemon [_thread_blocked, id=3060, stack(0x5b4a0000,0x5b5a0000)]
      0x534d9400 JavaThread "obj-skimmer" daemon [_thread_blocked, id=3964, stack(0x5b3a0000,0x5b4a0000)]
      0x53a99400 JavaThread "obj-skimmer" daemon [_thread_blocked, id=300, stack(0x5b2a0000,0x5b3a0000)]
      0x53492400 JavaThread "obj-skimmer" daemon [_thread_blocked, id=2312, stack(0x5b1a0000,0x5b2a0000)]
      0x538fb800 JavaThread "obj-skimmer" daemon [_thread_blocked, id=3400, stack(0x5b0a0000,0x5b1a0000)]
      0x5267b400 JavaThread "obj-skimmer" daemon [_thread_blocked, id=5944, stack(0x5afa0000,0x5b0a0000)]
      0x56a72c00 JavaThread "scheduler-0" [_thread_blocked, id=2380, stack(0x5aea0000,0x5afa0000)]
      0x53285c00 JavaThread "FusionReactor Web Server" [_thread_in_native, id=3332, stack(0x5aca0000,0x5ada0000)]
      0x567b5800 JavaThread "Timer-6" daemon [_thread_blocked, id=1876, stack(0x5aaa0000,0x5aba0000)]
      0x56991000 JavaThread "Timer-5" [_thread_blocked, id=5424, stack(0x5a9a0000,0x5aaa0000)]
      0x56993c00 JavaThread "Timer-4" [_thread_blocked, id=332, stack(0x5a8a0000,0x5a9a0000)]
      0x53f2a400 JavaThread "Thread-13" [_thread_blocked, id=2008, stack(0x5a4a0000,0x5a5a0000)]
      0x56958800 JavaThread "Timer-3" daemon [_thread_blocked, id=5648, stack(0x58320000,0x58420000)]
      0x53da6000 JavaThread "Timer-2" daemon [_thread_blocked, id=4076, stack(0x57db0000,0x57eb0000)]
      0x5765d800 JavaThread "Timer-1" [_thread_blocked, id=4140, stack(0x57850000,0x57950000)]
      0x53b10000 JavaThread "Timer-0" [_thread_blocked, id=3748, stack(0x57750000,0x57850000)]
      0x5378ac00 JavaThread "SeeFusion HTTP Listener" daemon [_thread_in_native, id=2120, stack(0x58220000,0x58320000)]
      0x537d7400 JavaThread "SeeFusion Request Watcher" [_thread_blocked, id=3692, stack(0x58120000,0x58220000)]
      0x57542400 JavaThread "SeeFusion History Sleepythread" daemon [_thread_blocked, id=5416, stack(0x58020000,0x58120000)]
      0x5755a800 JavaThread "SeeFusion File Watcher - seefusion.properties" daemon [_thread_blocked, id=4404, stack(0x57f20000,0x58020000)]
      0x53b11000 JavaThread "scheduler-20" [_thread_blocked, id=4196, stack(0x57bb0000,0x57cb0000)]
      0x539c8400 JavaThread "mipc-1" [_thread_in_native, id=5096, stack(0x57ab0000,0x57bb0000)]
      0x53c07400 JavaThread "Thread-4" [_thread_blocked, id=4932, stack(0x579b0000,0x57ab0000)]
      0x53537400 JavaThread "scheduler-19" [_thread_blocked, id=5828, stack(0x56650000,0x56750000)]
      0x53536400 JavaThread "scheduler-18" [_thread_blocked, id=796, stack(0x56550000,0x56650000)]
      0x53535000 JavaThread "scheduler-17" [_thread_blocked, id=2452, stack(0x56450000,0x56550000)]
      0x53534000 JavaThread "scheduler-16" [_thread_blocked, id=5872, stack(0x56350000,0x56450000)]
      0x53533400 JavaThread "scheduler-15" [_thread_blocked, id=3800, stack(0x56250000,0x56350000)]
      0x53532000 JavaThread "scheduler-14" [_thread_blocked, id=5772, stack(0x56150000,0x56250000)]
      0x53531000 JavaThread "scheduler-13" [_thread_blocked, id=3828, stack(0x56050000,0x56150000)]
      0x53530000 JavaThread "scheduler-12" [_thread_blocked, id=5336, stack(0x55f50000,0x56050000)]
      0x5352f000 JavaThread "scheduler-11" [_thread_blocked, id=5112, stack(0x55e50000,0x55f50000)]
      0x5352e000 JavaThread "scheduler-10" [_thread_blocked, id=4988, stack(0x55d50000,0x55e50000)]
      0x5352d400 JavaThread "scheduler-9" [_thread_blocked, id=2472, stack(0x55c50000,0x55d50000)]
      0x534dfc00 JavaThread "scheduler-8" [_thread_blocked, id=2340, stack(0x55b50000,0x55c50000)]
      0x534dec00 JavaThread "scheduler-7" [_thread_blocked, id=2672, stack(0x55a50000,0x55b50000)]
      0x53519c00 JavaThread "scheduler-6" [_thread_blocked, id=4056, stack(0x55950000,0x55a50000)]
      0x53518c00 JavaThread "scheduler-5" [_thread_blocked, id=2620, stack(0x55850000,0x55950000)]
      0x53517c00 JavaThread "scheduler-4" [_thread_blocked, id=4236, stack(0x55750000,0x55850000)]
      0x53516c00 JavaThread "scheduler-3" [_thread_blocked, id=3936, stack(0x55650000,0x55750000)]
      0x53515c00 JavaThread "scheduler-2" [_thread_blocked, id=5868, stack(0x55550000,0x55650000)]
      0x5352c400 JavaThread "scheduler-1" [_thread_blocked, id=4964, stack(0x55450000,0x55550000)]
      0x534da400 JavaThread "scheduler-0" [_thread_blocked, id=2512, stack(0x55350000,0x55450000)]
      0x5351ac00 JavaThread "Transaction Domain PrivateJmsDomain" [_thread_blocked, id=2392, stack(0x55250000,0x55350000)]
      0x53505400 JavaThread "clock" daemon [_thread_blocked, id=2096, stack(0x55150000,0x55250000)]
      0x534e1400 JavaThread "Transaction Domain DefaultDomain" [_thread_blocked, id=5864, stack(0x55050000,0x55150000)]
      0x53504400 JavaThread "tyrex.util.daemonMaster" daemon [_thread_blocked, id=6108, stack(0x54f50000,0x55050000)]
      0x534a2800 JavaThread "jndi-4" [_thread_blocked, id=6092, stack(0x54e50000,0x54f50000)]
      0x534f9000 JavaThread "jndi-3" [_thread_blocked, id=4720, stack(0x54d50000,0x54e50000)]
      0x534f8400 JavaThread "jndi-2" [_thread_in_native, id=704, stack(0x54c50000,0x54d50000)]
      0x534f7800 JavaThread "jndi-1" [_thread_blocked, id=4564, stack(0x54b50000,0x54c50000)]
      0x534ac800 JavaThread "jndi-0" [_thread_blocked, id=5016, stack(0x54a50000,0x54b50000)]
      0x534f5400 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=3420, stack(0x54850000,0x54950000)]
      0x534c0c00 JavaThread "jms-fifo-5" [_thread_blocked, id=2420, stack(0x54650000,0x54750000)]
      0x53479800 JavaThread "jms-fifo-4" [_thread_blocked, id=3188, stack(0x54550000,0x54650000)]
      0x53479400 JavaThread "jms-fifo-3" [_thread_blocked, id=5652, stack(0x54450000,0x54550000)]
      0x53478c00 JavaThread "jms-fifo-2" [_thread_blocked, id=4064, stack(0x54350000,0x54450000)]
      0x53286800 JavaThread "jms-fifo-1" [_thread_blocked, id=3940, stack(0x54250000,0x54350000)]
      0x534fd800 JavaThread "GC Daemon" daemon [_thread_blocked, id=2660, stack(0x54150000,0x54250000)]
      0x53461800 JavaThread "RMI Reaper" [_thread_blocked, id=3456, stack(0x54050000,0x54150000)]
      0x533dcc00 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=1340, stack(0x53f50000,0x54050000)]
      0x5262b000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4880, stack(0x52f40000,0x53040000)]
      0x52625400 JavaThread "CompilerThread1" daemon [_thread_blocked, id=4912, stack(0x52e40000,0x52f40000)]
    =>0x52624000 JavaThread "CompilerThread0" daemon [_thread_in_native, id=4680, stack(0x52d40000,0x52e40000)]
      0x52622c00 JavaThread "Attach Listener" daemon [_thread_blocked, id=4928, stack(0x52c40000,0x52d40000)]
      0x52621c00 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=544, stack(0x52b40000,0x52c40000)]
      0x52621000 JavaThread "Surrogate Locker Thread (CMS)" daemon [_thread_blocked, id=2700, stack(0x52a40000,0x52b40000)]
      0x52606400 JavaThread "Finalizer" daemon [_thread_blocked, id=5912, stack(0x52940000,0x52a40000)]
      0x52605400 JavaThread "Reference Handler" daemon [_thread_blocked, id=4664, stack(0x52840000,0x52940000)]
    Other Threads:
      0x52602400 VMThread [stack: 0x52740000,0x52840000] [id=2656]
      0x5262c400 WatcherThread [stack: 0x53040000,0x53140000] [id=4884]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    par new generation   total 218496K, used 75145K [0x03c60000, 0x13c60000, 0x13c60000)
      eden space 174848K,  35% used [0x03c60000, 0x0786c1c0, 0x0e720000)
      from space 43648K,  31% used [0x0e720000, 0x0f476510, 0x111c0000)
      to   space 43648K,   0% used [0x111c0000, 0x111c0000, 0x13c60000)
    concurrent mark-sweep generation total 786432K, used 85404K [0x13c60000, 0x43c60000, 0x43c60000)
    concurrent-mark-sweep perm gen total 131072K, used 69573K [0x43c60000, 0x4bc60000, 0x4fc60000)
    Dynamic libraries:
    0x00400000 - 0x00410000     C:\ColdFusion8\runtime\bin\jrun.exe
    0x7c800000 - 0x7c8c2000     C:\WINDOWS\system32\ntdll.dll
    0x77e40000 - 0x77f42000     C:\WINDOWS\system32\kernel32.dll
    0x7d1e0000 - 0x7d27c000     C:\WINDOWS\system32\ADVAPI32.dll
    0x77c50000 - 0x77cef000     C:\WINDOWS\system32\RPCRT4.dll
    0x76f50000 - 0x76f63000     C:\WINDOWS\system32\Secur32.dll
    0x77ba0000 - 0x77bfa000     C:\WINDOWS\system32\MSVCRT.dll
    0x6dac0000 - 0x6de7a000     C:\ColdFusion8\runtime\jre\bin\server\jvm.dll
    0x77380000 - 0x77411000     C:\WINDOWS\system32\USER32.dll
    0x77c00000 - 0x77c49000     C:\WINDOWS\system32\GDI32.dll
    0x76aa0000 - 0x76acd000     C:\WINDOWS\system32\WINMM.dll
    0x7c340000 - 0x7c396000     C:\WINDOWS\system32\MSVCR71.dll
    0x76290000 - 0x762ad000     C:\WINDOWS\system32\IMM32.DLL
    0x71bc0000 - 0x71bc8000     C:\WINDOWS\system32\rdpsnd.dll
    0x771f0000 - 0x77201000     C:\WINDOWS\system32\WINSTA.dll
    0x71c40000 - 0x71c97000     C:\WINDOWS\system32\NETAPI32.dll
    0x76b70000 - 0x76b7b000     C:\WINDOWS\system32\PSAPI.DLL
    0x6d320000 - 0x6d328000     C:\ColdFusion8\runtime\jre\bin\hpi.dll
    0x6d820000 - 0x6d82c000     C:\ColdFusion8\runtime\jre\bin\verify.dll
    0x6d3c0000 - 0x6d3df000     C:\ColdFusion8\runtime\jre\bin\java.dll
    0x6d860000 - 0x6d86f000     C:\ColdFusion8\runtime\jre\bin\zip.dll
    0x6d620000 - 0x6d633000     C:\ColdFusion8\runtime\jre\bin\net.dll
    0x71c00000 - 0x71c17000     C:\WINDOWS\system32\WS2_32.dll
    0x71bf0000 - 0x71bf8000     C:\WINDOWS\system32\WS2HELP.dll
    0x71b20000 - 0x71b61000     C:\WINDOWS\System32\mswsock.dll
    0x76ed0000 - 0x76efa000     C:\WINDOWS\system32\DNSAPI.dll
    0x76f70000 - 0x76f77000     C:\WINDOWS\System32\winrnr.dll
    0x76f10000 - 0x76f3e000     C:\WINDOWS\system32\WLDAP32.dll
    0x76f80000 - 0x76f85000     C:\WINDOWS\system32\rasadhlp.dll
    0x53600000 - 0x5360c000     C:\ColdFusion8\runtime\bin\portscan.dll
    0x5f270000 - 0x5f2ca000     C:\WINDOWS\system32\hnetcfg.dll
    0x71ae0000 - 0x71ae8000     C:\WINDOWS\System32\wshtcpip.dll
    0x68000000 - 0x68035000     C:\WINDOWS\system32\rsaenh.dll
    0x76920000 - 0x769e2000     C:\WINDOWS\system32\USERENV.dll
    0x6d7c0000 - 0x6d7c6000     C:\ColdFusion8\runtime\jre\bin\rmi.dll
    0x6d640000 - 0x6d649000     C:\ColdFusion8\runtime\jre\bin\nio.dll
    0x57950000 - 0x57957000     C:\ColdFusion8\lib\FusionReactor.dll
    0x77d00000 - 0x77d8b000     C:\WINDOWS\system32\OLEAUT32.dll
    0x77670000 - 0x777a9000     C:\WINDOWS\system32\ole32.dll
    0x5e2f0000 - 0x5e2fa000     C:\WINDOWS\system32\perfos.dll
    0x6d800000 - 0x6d808000     C:\ColdFusion8\runtime\jre\bin\sunmscapi.dll
    0x761b0000 - 0x76243000     C:\WINDOWS\system32\CRYPT32.dll
    0x76190000 - 0x761a2000     C:\WINDOWS\system32\MSASN1.dll
    0x54950000 - 0x549d0000     C:\ColdFusion8\lib\izmjniado.dll
    0x76cf0000 - 0x76d0a000     C:\WINDOWS\system32\iphlpapi.dll
    0x76cd0000 - 0x76ce9000     C:\WINDOWS\system32\MPRAPI.dll
    0x76df0000 - 0x76e24000     C:\WINDOWS\system32\ACTIVEDS.dll
    0x76dc0000 - 0x76de8000     C:\WINDOWS\system32\adsldpc.dll
    0x76b80000 - 0x76bae000     C:\WINDOWS\system32\credui.dll
    0x7c8d0000 - 0x7d0cf000     C:\WINDOWS\system32\SHELL32.dll
    0x77da0000 - 0x77df2000     C:\WINDOWS\system32\SHLWAPI.dll
    0x76a80000 - 0x76a92000     C:\WINDOWS\system32\ATL.DLL
    0x76e30000 - 0x76e3c000     C:\WINDOWS\system32\rtutils.dll
    0x7e020000 - 0x7e02f000     C:\WINDOWS\system32\SAMLIB.dll
    0x770e0000 - 0x771e8000     C:\WINDOWS\system32\SETUPAPI.dll
    0x77420000 - 0x77523000     C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.3959_x- ww_D8713E55\comctl32.dll
    0x54a00000 - 0x54a08000     C:\ColdFusion8\lib\CFXNeo.dll
    0x60020000 - 0x60030000     C:\WINDOWS\system32\MSVCIRT.dll
    0x57eb0000 - 0x57f15000     C:\WINDOWS\system32\MSVCP60.dll
    0x54a30000 - 0x54a3e000     C:\ColdFusion8\lib\cfregistry.dll
    0x57970000 - 0x57980000     C:\ColdFusion8\lib\PerfmonClient.dll
    0x6d0b0000 - 0x6d1de000     C:\ColdFusion8\runtime\jre\bin\awt.dll
    0x73070000 - 0x73097000     C:\WINDOWS\system32\WINSPOOL.DRV
    0x73860000 - 0x738ab000     C:\WINDOWS\system32\ddraw.dll
    0x73b30000 - 0x73b36000     C:\WINDOWS\system32\DCIMAN32.dll
    0x6d2c0000 - 0x6d313000     C:\ColdFusion8\runtime\jre\bin\fontmanager.dll
    0x54750000 - 0x54757000     C:\ColdFusion8\lib\NeoUUID.dll
    0x6d200000 - 0x6d22f000     C:\ColdFusion8\runtime\jre\bin\cmm.dll
    0x6d460000 - 0x6d484000     C:\ColdFusion8\runtime\jre\bin\jpeg.dll
    0x54770000 - 0x5477b000     C:\ColdFusion8\lib\clib_jiio_util.dll
    0x5d6c0000 - 0x5d7cc000     C:\ColdFusion8\lib\clib_jiio_sse2.dll
    0x547b0000 - 0x547bb000     C:\ColdFusion8\lib\mlib_jai_util.dll
    0x5d8d0000 - 0x5dd1e000     C:\ColdFusion8\lib\mlib_jai_mmx.dll
    VM Arguments:
    jvm_args: -Xmx1024m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:PermSize=128m -XX:NewSize=256m -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC -XX:SurvivorRatio=4 -XX:+UseParNewGC -XX:+HeapDumpOnOutOfMemoryError -Dcoldfusion.rootDir=C:\ColdFusion8\runtime/../ -Dcoldfusion.libPath=C:\ColdFusion8\runtime/../lib -Dcoldfusion.classPath=C:\ColdFusion8\runtime/../lib/updates,C:\ColdFusion8\runtime/../li b,C:\ColdFusion8\runtime/../gateway/lib/,C:\ColdFusion8\runtime/../wwwroot/WEB-INF/flex/ja rs,C:\ColdFusion8\runtime/../wwwroot/WEB-INF/cfform/jars -Djmx.invoke.getters=true
    java_command: <unknown>
    Launcher Type: generic
    Environment Variables:
    PATH=C:\ColdFusion8\runtime\..\lib;C:\ColdFusion8\runtime\..\jintegra\bin;C:\ColdFusion8\r untime\..\jintegra\bin\international;C:\ColdFusion8\verity\k2\_nti40\bin;C:\WINDOWS\system 32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
    USERNAME=xxxxx
    OS=Windows_NT
    PROCESSOR_IDENTIFIER=x86 Family 6 Model 23 Stepping 8, GenuineIntel
    ---------------  S Y S T E M  ---------------
    OS: Windows Server 2003 family Build 3790 Service Pack 2
    CPU:total 4 (4 cores per cpu, 1 threads per core) family 6 model 7 stepping 10, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3
    Memory: 4k page, physical 2097151k(1871136k free), swap 4194303k(3129772k free)
    vm_info: Java HotSpot(TM) Server VM (10.0-b19) for windows-x86 JRE (1.6.0_04-b12), built on Dec 14 2007 00:46:56 by "java_re" with MS VC++ 7.1
    time: Wed Nov 11 23:00:05 2009
    elapsed time: 71488 seconds

    Yes, that site is down. That is why I mentioned using google cache. Just google that url, and use the "Cached" option. 
    There is a lot of information in the link. So I would definitely review it to see if it matches your situation. But here is one snippet:
    "While these errors are found among various Sun bug reports, the only easy solution is an indirect one, to disable the HotSpot compiler entirely with the -Xint optional argument which forces it to only run in interpreted mode. The errors might be caused when HotSpot begins to optimized certain frequently run methods or tight blocks of code. When this happens the compiler will convert the interpreted bytecode to native code and tuck it away in a little piece of memory. The compiler probably needs a little chunk of contiguous memory to store the optimized native code and the OS was unable to provide it. Notice the errors usually indicate that attempts to allocate 1-2MB of memory failed, even though its often noted that neither the JVM heap nor the OS memory usage has maxed out at the time of crash.
    A more careful approach to resolve the crashes would be..."
    -Leigh

  • Showing various images on browser using JSP and Servlet

    Hello Guys!
    I am starting to develop in Java and already I am facing a big problem.
    If somebody will have some tip or suggestion, will be very well comings!
    The application must present in browser images originnally of format TIF. As it is not a native format of the I.E. , I converted the image for JPG (without saving it on disk) and send it to the browser a encoded image (encode) using JAI library in one servlet had access by a JSP. Then, the structure of my application is thus:
    1) an archive JSP draws the initial screen in browser and presents one input text.
    2) later that the user places the parameter, I make an access to the database and read a quantity of images to be presented.
    3) From there in the proper JSP, I use de tag img src to send image to the browser in agreement archive the amount of images.
    It follows the code of the JSP:
    <% 
                    int intI=0;
                    int intCont=0;
                    if(blnImagem == true){
                        out.println("<br>");
                        out.println("<table border=0 STYLE=border-collapse:collapse>");
                        out.println("<tr>");
                        for(intI=0;intI < Processo.intQtdImagens;intI++){
                           Imagem.strImgTif = Imagem.IndicarImagem(Processo.strNmPath,Processo.strSubPath,Processo.intNuImagem,intI);                                                                    
                           out.println("<th>");
                           out.println("<table border=1 STYLE=border-collapse:collapse rules='cols'>");
                           out.println("<tr>");
                           out.println("<th>");
                           %>
                             <img src="ShowImg" WIDTH=100>
                           <%
                           out.println("</th>");
                           out.println("</tr>");
                           out.println("</table>");
    %>and code on the ShowImg servlet:
            response.setContentType("image/jpeg");       
            ServletOutputStream sos = response.getOutputStream();
            RenderedOp src = JAI.create("fileload", Imagem.strImgTif);           
            ImageEncoder encoder = ImageCodec.createImageEncoder("JPEG",sos,null);       
            encoder.encode(src); 
            sos.close();The problem is if I have 10 images to present, it WILL BE it is executed 10 times and it passes 10 names of different archives, but in the page only the last image is presented 10 times. It is as if it processed the TAG to the end of everything in way that the value of the static variable Imagem.strImgTif was chore only with the last value and the same loaded image 10 times. How I make to solve this? Somebody has some idea?
    THANK YOU !
    Emidio

    If I understand correctly what your problem is:
    Do this in the jsp:
    out.println("<img src=\"ShowImg?image=" + intI + "\" WIDTH=100>");
    In the image servlet, get the "image" parameter and parse it as an int. Move the Imagem.IndicarImagem() call to the image servlet.

  • Using Java Advanced Imaging (JAI) in Applet

    I'm trying to port a JAI user interface to an applet using Apache Tomcat. When I try to display an image in the applet I get an exception and I have no idea what the cause is. I've opened up security completely (temporarily) to ensure that I'm not getting an error due to an applet security issue. Consequently, I'm able to browse/open files from the client.
    Here is the stack for the error I'm getting. Can anyone tell me what is causing this error? Thanks.
    Java(TM) Plug-in: Version 1.4.1_01
    Using JRE version 1.4.1_01 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\Administrator
    Proxy Configuration: No proxy
    c:   clear console window
    f:   finalize objects on finalization queue
    g:   garbage collect
    h:   display this help message
    l:   dump classloader list
    m:   print memory usage
    o:   trigger logging
    p:   reload proxy configuration
    q:   hide console
    r:   reload policy configuration
    s:   dump system properties
    t:   dump thread list
    v:   dump thread stack
    x:   clear classloader cache
    0-5: set trace level to <n>
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)
         at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1669)
         at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:481)
         at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)
         at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:805)
         at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:853)
         at javax.media.jai.RenderedOp.getWidth(RenderedOp.java:2135)
         at com.abi.protmodule.GelDisplayData.getGelImage(GelDisplayData.java:558)
         at com.abi.protmodule.ScrollingGelPanel.<init>(ScrollingGelPanel.java:58)
         at com.abi.ris.web.applet.GelEditPanel.showGelImage(GelEditPanel.java:76)
         at com.abi.ris.web.applet.GelEditApplet.openGelJButton_actionPerformed(GelEditApplet.java:159)
         at com.abi.ris.web.applet.GelEditApplet.chooseFileJButton_actionPerformed(GelEditApplet.java:136)
         at com.abi.ris.web.applet.GelEditApplet$1.actionPerformed(GelEditApplet.java:73)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
         at java.awt.Component.processMouseEvent(Component.java:5093)
         at java.awt.Component.processEvent(Component.java:4890)
         at java.awt.Container.processEvent(Container.java:1566)
         at java.awt.Component.dispatchEventImpl(Component.java:3598)
         at java.awt.Container.dispatchEventImpl(Container.java:1623)
         at java.awt.Component.dispatchEvent(Component.java:3439)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
         at java.awt.Container.dispatchEventImpl(Container.java:1609)
         at java.awt.Component.dispatchEvent(Component.java:3439)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    Caused by: java.lang.NoSuchFieldError: borders
         at com.sun.medialib.mlib.Image.initIDs(Native Method)
         at com.sun.medialib.mlib.Image.<clinit>(Image.java:2903)
         at com.sun.media.jai.mlib.MediaLibAccessor$1.run(MediaLibAccessor.java:223)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.media.jai.mlib.MediaLibAccessor.setUseMlib(MediaLibAccessor.java:220)
         at com.sun.media.jai.mlib.MediaLibAccessor.useMlib(MediaLibAccessor.java:185)
         at com.sun.media.jai.mlib.MediaLibAccessor.isMediaLibCompatible(MediaLibAccessor.java:391)
         at com.sun.media.jai.mlib.MediaLibAccessor.isMediaLibCompatible(MediaLibAccessor.java:314)
         at com.sun.media.jai.mlib.MlibScaleRIF.create(MlibScaleRIF.java:82)
         ... 39 more
    Could not find mediaLib accelerator wrapper classes. Continuing in pure Java mode.

    look at
    http://forum.java.sun.com/thread.jsp?thread=290960&forum=20&message=1261471
    and
    http://forum.java.sun.com/thread.jsp?forum=20&thread=173410
    It's something related with DLL libraries...

  • How to Import Custom Views and JSPs to ALBPM Enterprise

    Hi,
    I am using ALBPM 5.7. I have developed a custom view in Studio. When I publish and Deploy the Project in ALBPM Enterprise (WebLogic 9.2), I check true the Import Custom JSPs and Views (or similar terminology). But when I login to the portal after installing the EAR, the view is not listed in my work pane.
    Also, in one of the Interactive Activity I am calling a JSP, which gives a Null Pointer Exception when execute the instance, In my opinion, the Custom JSP is not deployed.
    I have also copied the JSP file in location \bea\ALPBM5.7\j2eewl\webapps\portal\customjsp\
    Please suggest as how do I deploy the View and JSP
    Thank you,
    Regards
    Jayant
    Edited by jayantbit at 06/19/2008 8:01 AM
    Edited by jayantbit at 06/19/2008 8:21 AM

    Hi Mohamed,
    Please check below link.
    What is Drag and Relate in SAP Business One - YouTube
    https://help.sap.com/saphelp_sbo882/helpdata/en/45/100314cf465d7ae10000000a11466f/content.htm
    https://help.sap.com/saphelp_sbo882/helpdata/en/45/10ff71cf465d7be10000000a11466f/content.htm
    SAP - SAP Business One: Your Solution for Generating Custom Reports
    Hope this helps
    Regards::::
    Atul Chakraborty

  • Create and deploy simple JSP

    Hi,
    I need to create simple JSP pages and deploy it to SAP J2EE engine.. what is the procedure?...I may later add some businness logic but not needed for now.
    Please help
    Thanks,
    Jai

    Hi Jai Paul,
    You would need to have the Netweaver Developer Studio installed. It is the IDE based on eclipse where you can develop applications and deploy onto the server.
    Chk out the following links. It has some tutorials and also explains the entire process of developing & deploying applications onto the portal.
    http://help.sap.com/saphelp_nw70/helpdata/en/83/4baa42cdccda11e10000000a155106/content.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/0d/1e3d41536ff323e10000000a155106/content.htm
    Regards,
    Abhishek

  • Error Diplaying TIFF in Applet through JSP

    Dear All,
    I've been trying to display the Tif image into the WebBrowser with the help of Applet embedded into a JSP through NetBeans IDE.
    To achieve this goal, I've created 2 projects "NewApplet" which contains the Applet class and "WebApplication1" which has "Index.JSP" which embeds the Applet.
    If i execute Only the Applet, it displays the TIF. But if i execute the JSP, it fires the following error:
    "URL Scheme is not "file" http://localhost:8084/WebApplication1/alpesh.tif""
    Following is the code written NewApplet.Java:
    {code}package display;
    import javax.swing.JApplet;
    import java.awt.BorderLayout;
    import java.awt.image.RenderedImage;
    import java.io.IOException;
    import javax.swing.JDesktopPane;
    import javax.swing.JInternalFrame;
    import javax.swing.JScrollPane;
    import com.sun.media.jai.codec.ImageCodec;
    import com.sun.media.jai.codec.ImageDecoder;
    import com.sun.media.jai.codec.TIFFDecodeParam;
    import com.sun.media.jai.widget.DisplayJAI;
    import java.io.File;
    import java.io.FileInputStream;
    import java.net.URI;
    import javax.swing.JOptionPane;
    public class NewApplet extends JApplet {
    @Override
    public void init() {
    URI FileName = URI.create(getCodeBase().toString().concat(getParameter("imageSource")));
    try
    File f = new File(FileName);
    FileInputStream stream = new FileInputStream(f);
    // Create a decoder using that stream.
    TIFFDecodeParam tiff = new TIFFDecodeParam();
    ImageDecoder dec = ImageCodec.createImageDecoder("tiff", stream, tiff);
    // Get the number of pages.
    int pages;
    pages = dec.getNumPages();
    // Set the application title.
    setTitle(pages+" pages in "+filename);
    // Create a JDesktop to hold the pages in internal frames.
    JDesktopPane desktop = new JDesktopPane();
    //getContentPane().add(desktop,BorderLayout.CENTER);
    desktop.setSize(400,400);
    add(desktop,BorderLayout.CENTER);
    // Open all images in the TIFF into the desktop pane.
    for(int i=0;i<pages;i++)
    // Get the image.
    RenderedImage ri = dec.decodeAsRenderedImage(i);
    // Create and set the user interface of an internal frame.
    JInternalFrame jif = new JInternalFrame("Page "+i,true,true,true,true);
    jif.getContentPane().add(new JScrollPane(new DisplayJAI(ri)));
    jif.setSize(400,400);
    jif.pack();
    jif.setVisible(true);
    // Add the internal frame to the JDesktop.
    desktop.add(jif);
    // Set the application closing behaviour, frame size, and show it.
    //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setSize(400,400);
    setVisible(true);
    catch (Exception e)
    JOptionPane.showMessageDialog(this, e.getMessage(), "alert", JOptionPane.ERROR_MESSAGE);
    {code}
    Following is the code written Index.JSP:
    {code}
    <APPLET code="display.NewApplet" ARCHIVE="NewApplet.jar" width=350 height=200>
    <param name ="imageSource" value="alpesh.tif"/>
    </APPLET>
    {code}
    Any Guesses?
    I've added the "dist/NewApplet.jar" in WebApplication1 through the option of "Properties->Build->Packaging" in NetBeans.
    Please help!
    - Alpesh

    Hi;
    This browser does not support Applets.What is yout browser?Please see:
    Recommended Browsers for Oracle E-Business Suite Release 12 [ID 389422.1]
    Recommended Browsers for Oracle E-Business Suite 11i[ID 285218.1]
    Regard
    Helios

  • Looking for sample code of JSP consumer of  XML

    Does anyone have info. on how to send XML to a JSP? Hopefully, I can have any client (able to post to http), create the XML, then send it off to a URL which is a JSP. The JSP then parses the XML and builds html based on data from the XML.
    Thanks,
    Jay

    I'm not quite sure I understand what you mean. Do you want someone to be able to send an xml file via Http POST and have you transform that to html to display?
    Anyway, here is some code wich may be useful.
    The following is from a servlet used to transform data generated from a sql database to xml and to send the xml to a browser:
         response.setContentType("text/xml");
         PrintWriter out         = response.getWriter();
         JDBC2XML jdbc2xml   = new JDBC2XML();
         DataSource ds         = JNDIBean.lookupDataSource(request.getParameter("dsName"));
         out.println(jdbc2xml.execute(ds, request.getParameter("sql")));In the above, the JDBC2XML just generates the xml from the sql.
    The following is from a servlet which recieves xml and transforms it to html. The servlet is mapped to *.xsl and uses the xsl file requested to do the transformation.
             TransformerFactory tFactory = TransformerFactory.newInstance();
             //get the real path for xml and xsl files.
             String ctx = getServletContext().getRealPath("") + FS;
             // Get the XML input document and the stylesheet.
             Source xmlSource = new StreamSource(new StringReader(xml));
             Source xslSource = new StreamSource(new URL("file", "", qryDoc).openStream());
             // Generate the transformer.
             Transformer transformer = tFactory.newTransformer(xslSource);
             // Perform the transformation, sending the output to the response.
             transformer.transform(xmlSource, new StreamResult(out));FS in above is: System.getProperty("file.separator");
    If you simply want a jsp to display xml using a stylesheet I suggest you use JSTL - it's simple to learn and all the work has already been done for you. BTW, if you so choose, feel free to modify/re-write any of the above code to meet your needs. YMMV.

  • Parameter passing from servlet to jsp page

    Hi
    I m facing problem of parameter passing from servlet to jsp ..
    plz help me...
    I m using as ...
    in servlet code I m using ...
    request.setAttribute("string",parameter);
    and in jsp..
    request.getParameter("string");
    regard's
    JAI KUMAR

    Hi Jaykumar
    You should use
    <%= request.getAttribute("sting") %> or
    ${string}
    in your jsp. I think you are trying to retrive the parameter instead of attribute.
    Thanks

  • Unable to call bean method at second JSP.

    I have a Bean called "Database" in that two methods
    1.public String methodReturnsString()
    2.public List methodReturnsList()
    And also i have three jsp's.
    1.First.jsp
    2.Success.jsp
    3.fail.jsp
    i called methodReturnsString of "Database" in the First.jsp ,after receiving intended String from the method methodReturnsString() i.e "success" or "fail" i can goto Success.jsp. or fail.jsp.
    Assume i got String "success" eventually leads me to Success.jsp , In this Success.jsp i was trying to access Bean method methodReturnsList() , Now the problem is I cant access the Bean method methodReturnsList() in Success.jsp, where i want to print the List that is returned by methodReturnsList().
    Can anybody tell me what is the mistake i am doing.
    here is "Success.jsp"
    <%@ page contentType="text/html"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    Login Successful
    <html>
    <f:view>
       <h:form id="result">
         <p>
                 <c:forEach var="x" items="${Database.methodWithList}" >
              ${x}
         </c:forEach>
                </p>
           </h:form>
    </f:view>
    </html>here is" Faces-config.xml"
    <?xml version="1.0"?>
    <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
         <managed-bean>
              <managed-bean-name>Database</managed-bean-name>
              <managed-bean-class>com.persistent.parashar.database.Database</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <navigation-rule>
              <from-view-id>/First.jsp</from-view-id>
              <navigation-case>
                   <from-action>#{Database.methodReturnsString}</from-action>
                   <from-outcome>success</from-outcome>
                   <to-view-id>/success.jsp</to-view-id>
              </navigation-case>
              <navigation-case>
                   <from-action>#{Database.methodReturnsString}</from-action>
                   <from-outcome>fail</from-outcome>
                   <to-view-id>/fail.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
    </faces-config>
    Here is Database.java
    public class Database {
         public List methodWithList()
              System.out.println("Contents in the List#########");
              List al=new ArrayList();
              al.add("jaya");
              al.add("chandra");
              al.add("raheem");
              al.add("balu");
              System.out.println("Contents in the List"+al);
              return al;
         public String methodReturnsString()
              return "success";
    }

    Thank you for reply, after making few chages by taking your suggestion i am still struggling to get the desired result in my jsp. please into the code below
    public class Database {
            public List calToDatabase;
         public static void initialCalToList()
              System.out.println("Contents in the List#########");
              List al=new ArrayList();
              al.add("JAya");
              al.add("chandra");
              al.add("raheem");
              al.add("balu");
              System.out.println("Contents in the List"+al);
              Database db= new Database();
              db.setCalToDatabase(al);  // calling the setter with list as an argument
    public List getCalToDatabase() {
              return calToDatabase;
         public void setCalToDatabase(List calToDatabase) {
              this.calToDatabase = calToDatabase;
         }I have also made changes in success.jsp
    <%@ page contentType="text/html"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    Login Successful
    <html>
    <f:view>
       <h:form id="result">
         <p>
               <c:forEach var="x" items="#{Database.getCalToDatabase}" >
                     ${x}
                   </c:forEach>
         </p>
       </h:form>
    </f:view>
    </html>

  • Java(jsp) problem....of combobox event

    hai here jai.....
    i m doing a project in jsp with backend postgresql.......
    my problem is.....i hv a combobox where i display department code from database....i hv done this.....now when i select a dept code in the combobox,then there is a textbox on the same page where corresponding ddo code of that dept code will be displayed from the database.....and the dept code and ddo code are 4m the same table of the database.....i can't do this......please help....give me the code in jsp......

    Try with the code below...I just implemented teh logic.You have to modify the code accoring to your need...............lemme know if it works or not...........
    <html>
    <head><script>
    function subit(){
    document.combo_chk.action='firstpage.jsp?combo='+document.combo_chk.combo.value;
    //alert(document.combo_chk.action);
    document.combo_chk.submit();
    function selit(){
    //alert(document.getElementById('<%=request.getParameter("combo")%>').value);
    document.getElementById('<%=request.getParameter("combo")%>').selected='true'
    </script>
    </head><%if(request.getParameter("combo")!=null){%>
    <body onload="selit()">
    <%}else{%>
    <body>
    <%}%>
    <form name="combo_chk" method="post" action="secondpage">
    <%
    String value="";
    if(request.getParameter("combo")!=null){
    //your code will go here..
    //dummy value for test
    value="edu1,edu2...................";
    //End dummy value for test
    }%>
    <select name="combo" onchange="subit()">
    <option value="home" id="home">HOME</option>
    <option value="education" id="education">EDUCATION</option>
    </select>
    empid<input type="text" name="empid" value="<%=value%>">
    </form>
    </body>
    <html>

  • Print from a jsp in linux

    Hi all,
    I've got a problem with a web application... :(
    I have deployed that application on a Tomcat 5 server, jre 1.4.2, the same version I used to build the war file.
    When I tested the application on a Windows Server everything was ok.
    the application list from a directory all tiff files present, display the one chosen by the user on the scrren. and, pushing the proper button, print the document.
    I used java.awt.print package in order to do this.
    well, when I run the application on linux I have
    java.awt.HeadlessException
         sun.print.PSPrinterJob.printDialog(PSPrinterJob.java:465)
    after I give thefilename to print to the printer class.
    the structure is:
    jsp page which contains the commands and the viewer area, in which I display the image (the src of the image is a displayingservlet).
    pushing the "print" button, the filename & path of the image displayed is given to the printTheDocument() method.
    my print class:
    import java.awt.Image;
    import java.awt.Toolkit;
    import java.awt.Component;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Color;
    import java.awt.BasicStroke;
    import java.awt.MediaTracker;
    import java.awt.HeadlessException;
    import java.awt.image.BufferedImage;
    import java.awt.image.RenderedImage;
    import java.awt.geom.Rectangle2D;
    import java.awt.print.PrinterJob;
    import java.awt.print.Book;
    import java.awt.print.PageFormat;
    import java.awt.print.Printable;
    import java.awt.print.PrinterException;
    import java.io.IOException;
    import javax.media.jai.PlanarImage;
    import com.sun.media.jai.codec.SeekableStream;
    import com.sun.media.jai.codec.FileSeekableStream;
    import com.sun.media.jai.codec.ImageDecoder;
    import com.sun.media.jai.codec.ImageCodec;
    public class PrintDocument {
        public static final int POINTS=72;
        static String fileName="";
        /** Creates a new instance of PrintDocument */
        public void printTheDocument(String filename) {
            fileName=filename;
            int numPages=getNumberOfPages();
            PrinterJob pj=PrinterJob.getPrinterJob();
            Book book=new Book();
            PageFormat pf=new PageFormat();
            pf.setOrientation(PageFormat.PORTRAIT);
            book.append(new Document(),pf,numPages);
            pj.setPageable(book);
            if(pj.printDialog()){
                try{
                    pj.print();
                }catch(HeadlessException ex){ex.printStackTrace();}
                catch(PrinterException ex){ex.printStackTrace();}
        public int getNumberOfPages(){
            int numPages=0;
            try{
                SeekableStream ss=new FileSeekableStream(fileName);
                ImageDecoder id=ImageCodec.createImageDecoder("tiff",ss,null);
                numPages=id.getNumPages();
                ss.close();
            }catch(IOException ex){ex.printStackTrace();}
            return numPages;
        private class Document extends Component implements Printable{
            public int print(Graphics g,PageFormat pf,int page){
                Graphics2D g2=(Graphics2D)g;
                g2.translate(pf.getImageableX(),
                        pf.getImageableY());
                g2.setPaint(Color.BLACK);
                g2.setStroke(new BasicStroke(1));
                Rectangle2D.Double border=new Rectangle2D.Double(
                        0,0,pf.getImageableWidth(),
                        pf.getImageableHeight());
                g2.draw(border);
                MediaTracker mt=new MediaTracker(this);
                String imageURL=fileName;
                try{
                    SeekableStream ss=new FileSeekableStream(imageURL);
                    ImageDecoder decoder=ImageCodec.createImageDecoder("tiff",ss,null);
                    int number=decoder.getNumPages();
                    RenderedImage[] image=new RenderedImage[number];
                    for(int i=0;i<number;i++){
                        image=decoder.decodeAsRenderedImage(i);
    PlanarImage image2=PlanarImage.wrapRenderedImage(image[page]);
    BufferedImage image3=image2.getAsBufferedImage();
    mt.addImage(image3,0);
    try{
    mt.waitForID(0);
    }catch(InterruptedException ex){ex.printStackTrace();}
    g2.drawImage(image3,
    (int)(0.25 * POINTS),
    (int)(0.25 * POINTS),
    (int)(6 * POINTS),
    (int)(8.5 * POINTS),
    this);
    ss.close();
    }catch(IOException ex){ex.printStackTrace();}
    return (Printable.PAGE_EXISTS);
    in windows it works properly.
    any idea???
    thanks, Camilla

    You need to set CATALINA_OPTS -Djava.awt.headless= true in your setenv.sh
    Cheers,
    Shravana.

  • JSP to call EBusiness Suite report

    We are running 11.5.9 on 9i looking for some direction on creating a jsp to run and display output of a report. Looking to reproduce the "Print Quote" action that is in the Qouting module - with other reports.
    Would like to know which version of JDeveloper we should use as well as any sugestions on how to accomplish this.

    Hi,
    I also want to work on crystal report but i dont have the ReportViewerBean.jar and ReportViewer.jar. So, please tell from where will i get those jar files.
    Thanks in advanced.

Maybe you are looking for

  • Order Analysis Toolkit is acting peculiar

    Salutations, What we're experiencing isn't so much an error as a lack of expected behavior. The big picture is this: we want to generate Bode & Polar plots from proximity probe data recorded during the startup/shutdown of a turbine. The problem is th

  • HT4528 On 6.0.2 just did some app updates on my iphone 5 and can no longer use wifi, same with my ipad

    Just did 4 updates to my ipad3 running IOS 6.0.1 and wifi now has problems, just checked my iphone5 running 6.0.2 and same problem exists.

  • How to downgrade easily from windows 8.1 OEM to Windows 7 Pro

    Hi, I've tried to get used to Windows 8.1 (7 months), but I did not find a solution to get the classic view (3D look instead of the extra flat look) nor to play spider solitaire in a windowed mode, it always opens in full screen (desktop PC 2560x1440

  • Bookmark Functionality

    I have an idea for Adobe Reader that I got while reading a document with MicroSoft Reader. I know that I am able to select a word within the document and insert a bookmark on the page where the word was selected so that I am able to go back to that p

  • Why do iPhoto export slideshows have missing photos

    Hello Everyone I am trying to export slideshows so I can burn to DVD later using iDVD.  But as i review my exported sideshow as a .mov file, it appears to have left out photos and is incomplete, it plays out the full music tracks but it simply is a w