Sawan Mishra

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

Recent posts by Sawan Mishra

Hi Everyone,

I am using jndi lookup for creating for creating a object of ejb in a third part library.I have jar file in my web-inf->lib folder but
if i do jndi lookup then i encounter naming exception.



I have Abc-core-1.0 jar file in my library and jar file has Abcservice class in the com.def.abc.service package but m getting namingexception



please give me some idea


Thanks & Regards
I've been using postgres database.But often wondered if there is any way to take a backup of a table having where clause.

Copy command doesn't seem to be elegant solution as we can't give remote server IP in it. And also if we need to execute it then manually we need to add Copy (all field names) STDIN; in the first line of sql file being generated.

Is there anyway to take a dump of a table conditionally even from a remote server.

If i try to access from one database to other Cross database reference not implemented message pops up.


Please someone tell how to take backup of a table having where condition from remote server or from local server in postgres.It should have insert scripts.




Hi everyone,
I am trying to run a sample hibernate program but m getting exception while invoking getTransaction().begin() of session.
exception m getting is:
org.hibernate.TransactionException: Unable to locate JTA UserTransaction


Here is my hibernate configuration file


As per my understanding hibernate needs a transaction for querying database.If transaction snt provided by
third party vendor then it should take by default transaction....
But dont know why this simple program snt working
please help me out


thanks
with regards
Hi everyone i tried closing the sql editor and also it didnt work.Then I changed the table name to apmc_dc_ref_category which was earlier
apmc_dc_reference_category then it worked fine.Actually i think the problem was coming because the foreign key constraint statement was having
reference(apmc_dc_reference_category) keyword
(

CONSTRAINT fk_1_apme_dc_reference FOREIGN KEY (apme_dc_tag_unit_refno)
REFERENCES apmc_dc_reference_category (apmc_dc_reference_sno) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION)

)..
After i changed the tablename its coiming correctly...


Can anyone say how i can have the same tablename and still be able to create the table


thanks
regrds


Hi everyone,
I m using SQLQuery to create one table...i 'm creating the foreign constraint in the program.

If i 'm executing the final Query generated in Sql editor then its the query is getting executed and table is created..
But while running the program the program gets hanged at insertQuery.executeUpdate()...

The query is generated is:::
CREATE TABLE apme_dc_reference
(
apme_dc_reference_refno integer NOT NULL ,
apme_dc_reference_name text ,
apme_dc_vendor text ,
apme_dc_version text ,
apme_dc_support_end_date text ,
apme_dc_extended_end_date text ,
apme_dc_subcategory text ,
apme_dc_edition text ,
apme_dc_technolgy_classification text ,
apme_dc_tag_unit_refno integer NOT NULL ,
apme_dc_version_refno integer NOT NULL ,
apme_dc_seqno integer NOT NULL ,
apme_dc_user_id text ,
apme_dc_field_filled_mode text ,
apme_dc_build_flag boolean ,
apme_dc_insert_timestamp timestamp without time zone DEFAULT now(),
CONSTRAINT pk_apme_dc_reference PRIMARY KEY (apme_dc_reference_refno),
CONSTRAINT fk_1_apme_dc_reference FOREIGN KEY (apme_dc_tag_unit_refno) REFERENCES apmc_dc_reference_category (apmc_dc_reference_sno) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION)


I cant find any mistake in it...but still database hangs at executeUpdate()...i hav no idea why its getting locked in this way...



please help me out
thanks
with regards
Yes I'm getting: hi dis is jsp.
In the form I have used method="post" so http post is request is made and it is working fine
when mapping is /reqServlet but results in blank web page when mapping is /*.

jsp page1:

<form action="<%=request.getContextPath()%>/NewFile2.jsp?name=roopam" method="post" >
enter text here<input type="text" name="text"/><br>
<center><input type="submit" value="submit"></center><br>
</form>



jsp page2:

<form name="myform" action="<%=request.getContextPath()%>/test/reqServlet" method="post">
<input type="text" value=<%=request.getParameter("text")%>></input>
<input type="submit" value="submit"/>
</form>

10 years ago
Hi everyone,

I have a doubt like when should we write content of object in Database and
when should we map object's content to file(serialize)???

Both are persistent memory but database are more advantageous since we have
power to query the database.

As both are existing both of them has there importance but we have to use them as per our requirement.
Then which persistent memory should be used when??


thanks in advance.
with regards
10 years ago
Hi bear,
If I'm requesting for NewFile.jsp(1st jsp page of my web app) then i'm getting blank web page after
I made web.xml servlet url mapping to /* and if i do view source then i'm getting:::::::

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type></HEAD>
<BODY></BODY></HTML>




what can be understood of it??

please tell me

thanks in advance
10 years ago
Thanks bear for replying.
But why blank web page is coming??
browser should display html code rendered by servlet.
why isn't doing that??


please tell soon.

thanks in advance
10 years ago
Hi everyone
I was studying how to map servlet to a URL where i got a doubt.
I will share with all of you kindly resolve it.

My web.xml:::::::::

<servlet>
<description></description>
<display-name>reqServlet</display-name>
<servlet-name>reqServlet</servlet-name>
<servlet-class>servlet.reqServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>reqServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>



In my dynamic web project I'm having 2 jsp page.
1st jsp page(NewFile.jsp) is passing the request to 2nd jsp page(NewFile2.jsp) and 2nd jsp page is passing the request to servlet and servlet is rendering html code
which is sent back to client as http response.

Now my doubt is if i am using <url-pattern>/reqServlet</url-pattern> then it is working normally.
But if I use <url-pattern>/*</url-pattern> then even the first jsp page(NewFile.jsp) is coming as blank web page.....


If I use <url-pattern>/test/*</url-pattern>then even the first jsp page(NewFile.jsp) then in browser after test if i write anything like /test/a or /test/b then blank web page is coming..



thanks in advance


10 years ago
Hi Bear,

Sure, a servlet can emit anything it wants to as the response, including HTML.
But that's not considered the best practice. The servlet should performa any processing
that needs to get done in order to prepare the page for display, and then forward to a JSP
to actually render the HTML.





thanks Bear for replying. But even if request is forwarded to jsp the jsp itself gets translated to
servlet and compiled and gets loaded to servlet engine and servlet engine runs this servlet so
ultimately whatever we are writing in jsp page must be becoming
out.println("content of jsp page") so servlet renders html code to web server which is sent back to browser
as HTTP response.

I'm not saying that servlet won't do processing but after processing it has to return some html code which will be
sent back to client as HTTP response.

thanks Bear
with regards
10 years ago
Hi Amit

Well servlet does not render HTML page, it is actually meant for control, but lets say for now it can produce some sort of response.



But in the servlet we are having all
out.println() statements so it renders a html document to servlet engine(Tomcat) and then html document is sent to web server that wraps it to HTTP response
and sends back this html document to browser.

please rectify me if necessary.

thanks in advance
10 years ago
hi
but murach's servlet book says:

when a web server receives the request for dynamic web page the server passes the request to web application
then application receives the request and generates a response usually a html page and web server wraps this response
html document in an http response and sends it back to the browser



Anyways if I'm using tomcat then its not application server as it has not implemented all j2ee features so
whatever you said regarding application server may not be applicable here.


please rectify me if necessary

thanks in advance
10 years ago
Hi everyone,
I have pursued my OCPJP certification with 90%.
BUT I'm very new to JSP and Servlet

I will tell my basic understanding on web application deployment and working.

please rectify if necessary

whenever client clicks on URL a HTTP request is made to web server like Apache and if the request is for dynamic
web page then request is passed to Tomcat(Servlet and jsp engine/web container) and that checks the deployment descriptor mapping
and passes the request to concerned Servletfor processing the request (instantiates the concerned servlet and invokes doGet() or doPost() based on HTTP request)
and this servlet will render a HTML page to web server and
that HTML page will be wrapped to HTTP response and will be returned to client browser



please do read and check above quote and let me know if i'm correct or wrong???


thanks in advance
10 years ago
hi Everyone
I was studying murach servlet and jsp book and i got some doubt in it.

when a web server receives the request for dynamic web page the server passes the request to web application
then application receives the request and generates a response usually a html page and web server wraps this response
html page in http an response and sends it back to the browser





From above line can it be inferred whenever request for static web page comes then web server directly renders that
to browser as http response and if request for dynamic web page comes then it is passed to web application then then
application receives the request and generates a response usually a html page and web server wraps this response
html page in http an response and sends it back to the browser.

tell me whether my above inference is correct or wrong?

And next doubt of mine is:

How server is going to know whether request made refers to static or dynamic web page?

I think based upon the URL pattern mentioned in the deployment descriptor server is going to understand if the request
is dynamic then to which servlet it should be passed for processing.


please do read my understanding that i have written above and correct it if i'm wrong and if possible brief entire sequence of operation in this context


thanks in advance


10 years ago