Name:
Location: Hyderabad, Andhra Pradesh, India

Tuesday, December 07, 2004

java groups ..............

the log generates a Scheme script (using Kawa)



testing and debugging under SSL.Yes, SSL is _supposedly_
transparent to the browser...

simple PC proxy (Http Proxy-Spy)


My favorite IE4.0 bug: if you POST form data in IE4
to an SSL server with a non-Verisign cert, you have to step through a
dialog accepting the new Certificate Authority, after which IE4 gladly
resumes the POST - without the data. Took a little while to figure
out what was going on there.

I know that integrating SSL involves licensing issues.


WebLoad from Radview.
It has a number of features but
at the core it allows you to visit a website, do "stuff" across a number of
pages and then save that as a use case. You can then build a scenario
composed of multiple use cases. (The use case is a script that can be
replayed later with a number of options incl. many threads). Very good from
testing perspective and can be mapped to Use Cases proper. Take a look at
the tool and other commercial or semi-coffercial offerings to get a better
idea of a feature set.


(like all Tapsell-Ferrier work) GPLed

oxymoron


API 2.2 strongly encourages webapp packaging


-----------------------------------------------------------------------------------

http://www.w3schools.com/soap/default.asp


i use orian as servlet contener and apache for php



case study

hi i work in a java projetc that integrat with many
> > application
> > this application is clusterd in 2 machiens and
> > integrate with php application
> > run in apache http server
> >
> > what i need to know is
> > how to syncronize user account between all these
> > apllication and how to enable
> > sso Single sign on
> > 2 ) when i press log out button on the main
> > application how can i destroy the
> > session in atheres applicatino i mean php
> > applications and java apllications in
> > anathere web context



sever clustring/load balancing and
> session replication.

--------------------------------------------

Invoke the ejb methods from the respective action classes.

If its a production
application then have a simple java class (Business Delegates) to abstract
out
the web layer and have the EJB calls in the Business Delegates


I am not sure whether STruts supports EJB coz
i think Struts is a typical web framework with no
support for Enterprise Applications.
Please neone having concrete idea come up n suggest
the same to the group.
If it supports Enterprise Applications then of course
we need to use Business Delegate Design Pattern in
order to abstract the EJB Layer from the Web Layer.

Struts like u said is a web framework but at the same time it need not
support Enterprise Applications or anything else. This framework is just an
abstraction and the containers have to support struts and not vice versa.
Hence, struts can be used in any kind of deployment instead of the normal jsp
layer.
I think, the business delegate pattern is a good option for Rajat's
problem. Another option could be using a proxy class for all backend
interactions, thus clearly demarking the weblayer from the rest. I do not
know, in which design pattern this can be classified.



I still am not sure whether you
can call methods on the Home Interface of Business
Delegate Class from the Action Class?
Really If its possible then how can it be put into
implementation?

You can call any method on any delegate or in fact the bean itself from
ur action class. For all practical purposes in order to access an EJB, an
action class is but another class. U can make JNDI calls from ur action class
itself. I hope I hv answered ur question, if not plz revert back.

Hi All,
EJBException subclasses RuntimeException , so
when an EJBContainer throws an EJBException , it wraps
it in a RemoteException before returning it to the
client Application which is invoking the EJB.
For Ex - ยท If the ejbLoad and ejbStore methods cannot
locate an entity in the underlying database, they
should throw the javax.ejb.NoSuchEntityException. This
exception is a subclass of EJBException. Because
EJBException is a subclass of RuntimeException, you do
not have to include it in the throws clause. When
NoSuchEntityException is thrown, the EJB container
wraps it in a RemoteException before returning it to
the client.
So at client side Application , how are we suppose to
know that NoSuchEntityException is thrown at the EJB
level coz every System level exception is wrapped in a
RemoteException before returning it to the client.


You can call getCause() method on the RemoteException object at client side.
It will return you the wrapped
remote exception.


System Level Exceptions can't be handled by
bean's client program so then how does it interpret as
to what is wrapped in the remote exception.

Could u just explain me with some code...
Is it possible to catch the System Level exceptions
like RemoteException in our EJBClient Program.

For ex can we have like this in our EJBclient Program
try
{
//invoking methods on EJB via Remote Interface.
}catch(RemoteException e)
{

}


TRY THIS IN UR CLIENT CODE...


Try {

........

......

remoteObject.remoteMethod( );

......

} catch( RemoteException re ) {

Throwable th = re.getCause( ); // same as Throwable
th = re.detail;

System.out.println( th.getCause( ) ); // most likely it will
print null, untill the nested exception in "th" does not have a nested
exception in it also.

System.out.println( th.getMessage( ) );

}


Yes that is what is good design. Have EJB calls in a seperate class( That is
what I called Business Delegates) and call those from
Action Classes. If there are multiple Business Delegate calls then add a
facade :)


the CLIENT has no need to know the system level exception.
Only app level exceptions he need to know bcoz he can do something to
continue or he can roll back.
but reagrds system level exception, there is no need like that ...only
thing he needs to know is thet SOME system exception has happened.
It is the responsibility of the system/container to do the needful



http://www.husted.com/struts/tips/018.html


http://www-106.ibm.com/developerworks/java/library/j-ejbexcept.html
----------------------------------------------------------------------------------

How can I declare global variable in Servlet and JSP which can be accessed by all other Servlets / JSP present in the same container

U can use session variables which are available thru out the session and
are accessable by all jsps/servlets

Use Application object for that.....


or u can use ServletContext, which can be accessed by all servlets/jsp within a container.

This can be done by setting the variable in
ServletContext.Use getAttribute() and setAttribute
methods of ServletContext.


Using application variable one can access across the SERVLET/JSP page.

In Servlet
ServletContext context = getServletConfig().getServletContext();
context.setAttribute(string_name, object) ; // for setting the variable with value
context.getAttribute(string_name) ; // for getting the value

In JSP
application.setAttribute(string_name, object) ;
application.getAttribute(string_name) ;


Well, it depends on what kind of information he is intending to share.

If this information is of application scope, and this application isn't
expected to run in multiple servers, the ServletContext fits perfect.

If the information is specific to a sessioned user, so there's no doubt he
must use sessions.

And finally, if this information has application scope, and the application
is intended to run in a multiple server configuration (distributable
application), so it's better to persist this information in an outside
environment such as a database server.

hi, put ur attributes in ServletContext object, so that they will be
visible in every file within the context.





-------------------------------------------------------------------------------------

<%
try {
Properties properties = new Properties( );
properties.load( new FileInputStream( new File( "library.properties" )
) );
out.println( properties );
} catch( java.io.FileNotFoundException fnf ) { out.println( fnf ); }

%>


The code written above is a piece of code from my jsp file. I want to load
library.properties file into the properties object.
But I get java.io.FileNotFoundException.

I am deploying my application on BEA Weblogic 7.0 using jdk1.3.1_06. I am
keeping this file in the same directory, where my jsp files are lying.
But I am getting this exception. (I have also tried by keeping the file in
the directory where weblogic is keeping the complied servlet. but it is
still not working. Although I don't any such kind of solution. I have also
tried by all relative paths. I don't want to hardcode the full path of the
file.) I have tried to load a properties file in a simple Test class, there
it works.

import java.io.*;

public class Test {

public static void main( String ar[] ){
File file = new File( "A.txt" );
System.out.println( file );
}
}


It works in the above code. here A.txt at the same place, where Test class
is.

please give me some solution.
http:\www.hcltechnologies.com


I am not sure whether relative paths work
while reading the file. It needs the physical path
hardcoded into it.So what u can do is instead of
hardcoding the physical path in the jsp file.Put the
hardcoded value in some parameter in the config file
and read the value from it.But then the config file
needs to be read everytime u invoke a jsp again.


I cannot figure out the cause for the error u r getting but the foll code I
hv used and it works, that is if u want to use it as a resource bundle.

ResourceBundle.getBundle("library", new Locale("en","US"));

Note: I hv not mentioned the extension that is ".properties" is omitted from
the file name.

Tell me if it works.

The system cannot resolve the classpath for the property file. So it failed
to load.

Try the following piece of code, it will solve the problem.

String PROP_FILE = "library.properties";
try {
InputStream propFile =
this.getClass().getClassLoader().getResourceAsStream(PROP_FILE);
Properties properties = new Properties();
properties.load(propFile);
propFile.close();
}
catch(IOException ioe){
}

Thanks a lot. It worked using ur method.
But to use ur method, i had to keep library.properties in classpath, And it
worked.

Yes Praveen, u need to keep the library.properties file in ur classpath.


--------------------------------------------------------------------------

Try by this way.
Just create a simple new file in you jsp namely,
"x.txt", and check where the file is going to be
creating in your web logic. By this you can find out
where servlet context is going to create file for your
web application. And then place your required file in
that location.
--------------------------------------------------------------------------
hi ,
i am using tomcat 3.2.1 for deploying servlets and jsp. i am using it from past 2 years. recently i am getting the following error in tomcat. its printing this error continuously in tomcat console.

The error is following

java.io.IOException: The filename, directory name, or volume label syntax is inc
orrect
at java.io.Win32FileSystem.canonicalize(Native Method)
at java.io.File.getCanonicalPath(File.java:437)
at org.apache.tomcat.util.FileUtil.safePath(FileUtil.java:184)
at org.apache.tomcat.core.Context.getRealPath(Context.java:797)
at org.apache.tomcat.request.StaticInterceptor.requestMap(StaticIntercep
tor.java:196)
at org.apache.tomcat.core.ContextManager.processRequest(ContextManager.j
ava:835)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.
java:786)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758
)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnectio
n(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:
416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java
:501)
at java.lang.Thread.run(Thread.java:484)
2003-09-04 12:01:42 - Ctx( ): 404 R( + http:/www.commonname.com/en/agent/hello
.asp + null) null


please help me in solving this. rakesh


I've never seen this error before, but i suppose it's related to path names.

It seems the problem is a getRealPath call on a request Map, so maybe this
error lies on your web.xml file.

Maybe you are passing an inverted slash "\" in a place where tomcat is
expecting a normal slash "/" or vice-versa.


----------------------------------------------------------------------------
Java is not 100% Object Oriented because it still use primitive
datatypes like int,long,float etc.,The designers of java can made this as
object,but it will increase the memory and reduce the performance.so they
are retained as primitive datatypes.They have given a provision to make
them objects,if necessary throu' Wrapper Classes.


http://www.javaworld.com/javaworld/javatips/jw-javatip30.html
http://www.faqs.org/docs/think_java/TIJ309.htm


Can u do operator overloading in java ?no

Operator overloading is a special option. It is not required to support
polymorphism.

Safe programming is an important issue in Java so Op. Ov. is not allowed.
But it doesn't mean polymorhism is not supported by Java.

I think method overriding is enough to support the polymorhism

Internally java uses operator overloading and pointers but it does not allow a programmer to do the same

http://java.sun.com/people/jag/FP.html#overloading

An interesting thread on this in google groups:

http://groups.google.com/groups?q=g:thl543828996d &dq=&hl=en&lr=&ie=UTF-8&edition=us&selm=st1s4usuj6mfcdhjq4n8n8app5h4td40gm%404ax.com

There are 136 posts there! Pretty messy URL. You might want to search for " James Gosling wants operator overloading in Java"
in groups.google.com and read the first currently first entry there..
-----------------------------------------------------------------------------


use eMule




0 Comments:

Post a Comment

<< Home