Rajeev roushan sharma

Ranch Hand
+ Follow
since Jan 28, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Rajeev roushan sharma

Bear Bibeault wrote:Do you mean that you want to pre-compile the JSPs as part of a build? Some containers provide a JSP pre-compiloer. Which are you using?


I was not clear it seems. Before build or during maven build i want to read JSP files.Like XML parsing, can we parse JSP also ?
12 years ago
JSP
Hi All, I want to parse all the JSPs at the time of MAVEN build. Even google did not help. Any help is appreciated.
12 years ago
JSP

Hi, if you get the solution, could you please share.
Thanks




sarma kiran wrote:I am able to connect to SQL * Plus..

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jul 29 08:51:27 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn system
Enter password:
Connected.
SQL> select instance_name from V$instance;
INSTANCE_NAME
----------------
xe
SQL>

Here is the listener status and services


C:\>lsnrctl services

LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-JUL-2008 08:46:43
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Services Summary...
Service "XEXDB" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1002 state:ready
DISPATCHER <machine: KIRANKUMAR-PC, pid: 3632>
(ADDRESS=(PROTOCOL=tcp)(HOST=KiranKumar-PC)(PORT=49160))
Service "XE_XPT" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "xe" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
The command completed successfully


C:\>lsnrctl status

LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-JUL-2008 08:46:56
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
Start Date 29-JUL-2008 08:39:27
Uptime 0 days 0 hr. 7 min. 29 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\listener.ora
Listener Log File C:\oraclexe\app\oracle\product\10.2.0\server\network\log\listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=KiranKumar-PC)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=KiranKumar-PC)(PORT=8080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "XEXDB" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Service "XE_XPT" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Service "xe" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
The command completed successfully

C:\>TNSPING xe
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-JUL-2008 08:49:28
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = KiranKumar-PC)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))
OK (250 msec)


C:\>tnsping kirankumar-pc
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 29-JUL-2008 08:49:42
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\sqlnet.ora
Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
OK (170 msec)


Please check this... Let me know the solution..

Bear Bibeault wrote:Any performance difference will be irrelevant.


My Question is "Whether there is any performance issue" ?

13 years ago
JSP
Hi All, suppose we have some taglib tag defined in main page and again we define the same taglib in the included page, we can understand that it is redundant because it is already defined in the main page. I want to understand is there any performance issue ?

Thanks in advance!

regards,
rS
13 years ago
JSP

Bear Bibeault wrote:There are a number of errors with this code:

  • Firstly, using scriptlets in a JSP is a poor practice that should have been eradicated years ago. Bad idea.


  • Secondly, the code assues that the variable exception is not null. This is an invalid assumption. Hence, when it is null, a null pointer exception is raised.





  • Thanks a lot Bear but the it is only test code not for production.
    13 years ago
    Hi ALL, I have mapped error page in DD.

    And I am setting error from servlet like .
    errorpage.jsp:

    Getting below ERROR in console:
    SEVERE: Exception Processing ErrorPage[errorCode=404, location=/views/erorpage.jsp]
    org.apache.jasper.JasperException: java.lang.NullPointerException
    at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:438)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:424)
    at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:343)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.NullPointerException
    at org.apache.jsp.views.erorpage_jsp._jspService(erorpage_jsp.java:60)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)

    I am not able to understand why NulllPointer exception is coming. Please let me know how can we pring error msg in jsp.
    Your help will be highly appreciated...

    13 years ago

    Bear Bibeault wrote:

    Rajeev roushan sharma wrote:Hey Edward, No need to use session and all in your scenario. If you are using the RequestDispather to forward to your JSP then you will get the same request in your JSP too. so you can simply write request.getParameter("param1") and your are done!


    That will not work in his scenario as the data needs to be available across multiple JSPs as per his original post.


    You can use the same request querystring with your link..

    13 years ago
    Thanks Paul, I got your point. I have seen service method implementation in httpservlet class. Ultimately doGet or doPost etc is called on request method. Thanks again.
    13 years ago

    Edward Manalansan wrote:Here is the sequence..
    1. Query string is http....\servlet1?param1=test
    2. In servlet1, I store param1 using httpsession, then displays param1 in jsp1(no issues) using Requestdispatcher.
    3. Jsp1 uses form action = servlet2, in servlet2 when I issue..

    GISAddress gisaddress = (GISAddress) request.getAttribute("gisaddress");

    gisaddress.getParam1();

    it is null.

    I used the same GISAddress in jsp1 and it is working, somehow GISAddress is gettting destroyed prior or when servlet2 is fired.

    Thank you.




    Hey Edward, No need to use session and all in your scenario. If you are using the RequestDispather to forward to your JSP then you will get the same request in your JSP too. so you can simply write request.getParameter("param1") and your are done!
    13 years ago
    Thanks for your reply. The other question is why separate methods are there in SEEVLET api for each request method ? could you please clarify this also ?

    13 years ago
    you should never use JS to perform navigation. I would have done below to perform the same thing.
    i)make page1 as welcome file and create a session in this page(oneliner code).
    ii)No need to write JS and onclick handler. Make and simple anchor and put css to look like button. put href="/controller?pagename=page2" in 2nd page, same repeat for other JSP.
    iii)Simply you make a Servlet controller and pass a querystring("pagename") and check preexisting session like(httpsession session=request.getSession(false)), if exist then forward to pagename parameter value otherwise create a new session and forward to welcome page.
    and your are done. Not sure whether it is a best approach but better.
    13 years ago
    JSP
    how navigation is happening from one JSP to another? i think this should be stored as request attribute.
    13 years ago
    Hi All, I have one doubt, why there are 7 request methods(like doGet,doPost etc..) are available in Servlet API ? if we want to write logic based on request method then we have httprequest.getMethod(). JSP is finally converted into a servlet class but there is no request methods. I know that JSP is used as view and servlet is used as controller.

    Thanks in advance!

    Best regards,
    rS
    13 years ago