Brijesh shah

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

Recent posts by Brijesh shah

Hi folks,

I want to integrate twitter api in my web site and once this gets authenticate through twitter login from my site, I would need to fetch logged in users followers list.

I have created twitter application and have related consumer key an all those information.

However, from twitter api site,I am not getting exact authentication process to follow the way it is available in facebook, linkedin..

If someone having idea about my usecase then request you o please assist me on this.

Thank you.

--
Brijesh
(91-9167593777)
9 years ago
JSP
Hi folks,

I want to integrate twitter api in my web site and once this gets authenticate through twitter login from my site, I would need to fetch logged in users followers list.

I have created twitter application and have related consumer key an all those information.

However, from twitter api site,I am not getting exact authentication process to follow the way it is available in facebook, linkedin..

If someone having idea about my usecase then request you o please assist me on this.

Thank you.

--
Brijesh
(91-9167593777)
9 years ago
Hi folks,

As mentioed, we are having problem in getting correct date as expected..

Issue : as per day light saving EST time , whatever IST time we are giving as input it gets reduce to one day according to ESt time..

We areusing code for the same as folllows :

Long clientOffset = (Long) FlexContext.getFlexSession().getAttribute("clientTimezoneOffset");
if (clientOffset == null) {
clientOffset = new Long(0);
}
Calendar cal = Calendar.getInstance();
int serverOffset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET) / (60 * 1000);
d.setTime(d.getTime() + (serverOffset - clientOffset));


Your revert with solution would be highly appreciated..

Please let me know in case of any clarification required.

--
Brijesh
Hi folks,

To understand preventing clone while using singleton, I should know to verify the behavior of clone in singleton first..

for this I have created singleton class as follows:
package foo;
public class SingletonObject implements Cloneable{
private static SingletonObject ref;
private SingletonObject(){
System.out.println("Inside the singleton constructor");
}

public static SingletonObject getSingletonObject(){
if(ref==null){
ref=new SingletonObject();
System.out.println("Creating new instance...");
}else{
System.out.println("Old obj...");
}
return ref;
}
public Object clone() throws CloneNotSupportedException{
return super.clone();
}
}


//Other code through which I am fetching
package foo;

public class FetchSingletn {

public static void main(String[] args) throws CloneNotSupportedException {

SingletonObject singletonObj=SingletonObject.getSingletonObject();
singletonObj.getSingletonObject();
SingletonObject clone=(SingletonObject)singletonObj.clone();//line1
clone.getSingletonObject();

if(singletonObj.equals(clone)){
System.out.println(" You created another instance of your singleton !!!");//When this will satusfy???
}
}

/* out put : Inside the singleton constructor
Creating new instance...
Old obj...
Old obj...
*/

My question is to prevent clone how I will be able to recognise and my condition of singleton and clone object equality would get possible..

Your response towards this would be higly appreciated to understand singleton concept of cloning.

Thank you..

Regards,
Brijesh Shah
Hi folks,

I have one query related to understanding of creating new String object and String literal.

As per my knowledge if I creates String s1 = "abc" then new string object of abc will create in string pool in stack memory and if I creates String s1 = new String("abc"); then new string object of abc will created in heap memory.. Please correct me if I'm wrong.
If I'm wrong in understanding then bit of explanation with correct answer would be highly appreciated.

Suppose we have code snippets as follows:

String s1 = "abc";
String s2 = new String("abc");//this will create new string object of abc in heap memory??
s1 = "def";
s2 = null;

Now what will happen to abc ???If it is eligible or garbage collection then in what period of time this will be allocated for garbage collection??

Looking forward for your feedback on this.

Thanks and
Best Regards,
Brijesh Shah
Hi folks,

My development scenario and its related query is as follows:

1) Suppose there are four rows for the same registerationId in the table

2) Now, while iterating this four rows in jsp my condition is like if userId falls in second row den respected response to be printed and then it should not go to iterate in 3rd and fourth row..

3) There is no syntax related to Break in OGNL . If it is there then would request you to provide me solution for related scenario.

Looking forward for your feedback.

Thanks and
Best Regards,
Brijesh shah

11 years ago
Hi,

I want to create simple rest web service using REST Api..


I have eclipse 3.4 ganemede + tapache tomcat 6.0 + jdk 1.5 installed in my system. However, I don't find any web service project option to create Web service using my current eclipse version..

If it is possible to create rest web service in my available versin or is her sny plugins requiredto install then please kindly assist me to go ahead for further devlopment..

Thanking you!!

best Regards,
Brijesh shah
12 years ago
Hi all,

There is one scenario in which I use <scripting-invalid> as true or <el-ignored> as true.

After this, if I try to access any scripts or el in my existing Jsp then will it give compile time error, translation error or runtime error??

--
Brijesh
Hi all,

I am going through HFSJ( second edition) for SCWCD preparation. While learning Business delegate pattern on page number 757 wherein I have some queries.

On Fifth step,The controller forwards request to the View JSP. The JSP gets a reference to the Customer bean (stub) from the request object. According to this, view is retrieving its desire request from remote object through stub, then why we would require another sixth step where JSP uses EL to get the Customer Bean properties to satisfy the original request???

Appreciate your answer for my better clarity.

Thank you.

--
Brijesh
Dear All;

While I am writing following code in java; and then executing this code in jsp page to have counter of every on load jsp page..

package admin;

public class pageCount {

public int counter;

public int getCounter(){
System.out.println("INSIDE *****");
counter++;
return counter;

}

}

So i am calling above code in jsp page as follows..

<%@page import="admin.pageCount;"%>

The page is
<%
out.println(pageCount.getCounter()); // this says can not make static reference to non static method getCounter() from the pageCount
%>


To make above code of Jsp properly runnable i need to make public int counter and getCounter() method static..


My query is why we need to make variable in java code as static to access the same in jsp page..

Hope to hear on this soon...

Thanking you in advance.

Best Regards;
Brijesh
14 years ago
JSP
Hello;

Can anybody please explain me by conceptually how to handle multiple threading in servlet...

Thanking you.

Best Regards;
Brijesh Shah
14 years ago
Dear Friends;

In general by referring different types of servlet examples , I have found that in some examples they have used doGet and doPost method together in the code.. I want to know logic behind it.

I do not understand the concept of using doGet and doPost methods together in the Servlet..I want to know, Why and when we would need to use both methods together in the servlet code.

Thanking you.

--
Brijesh

Dear Ranchers;

I am a begginer in spring framework.

I want to learnm about web and MVC module in spring framework.

I have installed eclipse 3.2, Ant built tool and using Apache-tomcat5.5.

Would appreciate if somebody provide me learning project examples, tutorial link or perfect book on the above specified details( Which would include apache tomcat,ant,eclipse and information of WEB, MVC)

Thanking you in advance.

Thanks &
Best Regards;
Brijesh Shah
Dear Ranchers,

I am trying to interact with the Tomcat server throught ant, it works for me
for the list command, but I can't start or stop the server.

I am using the following target invocation:

<target name = "start"
description = "Start Tomcat application"
>
<start
url = "http://localhost:8080/manager"
username = "admin"
password = "tomcat"
path = "/springapp"
/>
</target>

I have installed jdk 1.6_02 and also java runtime 1.6 for Tomcat 5.5.


If I execute after staring the server manually the list task it works, but
start and stop commands don't work.

1. Do I have to use jdk 1.6 with Tomcat 5.5? During the Tomcat installation
I have selected a 1.5 runtime version.

2. Do I have to use a previous version of tomcat?

3. Is there any way to say during the ant execution that it should invoke
the tomcat tasks assuming another runtime versions?



After running this target on verbose mode I get the following output:

==================================================================
Detected Java version: 1.4 in: C:\Java\j2sdk\jre
Detected OS: Windows 2000
parsing buildfile P:\springapp\build.xml with URI =
file:///P:/springapp/build.xml
Project base dir set to: P:\springapp
Importing file properties.xml from P:\springapp\build.xml
parsing buildfile P:\springapp\properties.xml with URI =
file:///P:/springapp/properties.xml
[property] Loading C:\Documents and
Settings\UF367151\springapp_build.properties
Property ${user.properties.file} has not been set
[property] Loading P:\springapp\${user.properties.file}
[property] Unable to find property file:
P:\springapp\${user.properties.file}
[property] Loading P:\springapp\build.properties
Override ignored for property junit.printsummary
Override ignored for property junit.fork
Override ignored for property junit.showoutput
Override ignored for property junit.haltonfailure
Override ignored for property junit.formatter.type
Override ignored for property junit.formatter.usefile
Importing file taskdef.xml from P:\springapp\build.xml
parsing buildfile P:\springapp\taskdef.xml with URI =
file:///P:/springapp/taskdef.xml
[property] Loading P:\springapp\messages.properties
Build sequence for target `start' is [start]
Complete build sequence is [start, undeploy, load-data, compile, build,
deploy, drop-tables, show-properties, junit-do, print-properties, install,
stop, reload, clean, usage, help, init, list, clear-data, print-data, junit,
create-tables, deploywar, ]
start:
BUILD FAILED
P:\springapp\build.xml:236: java.net.ConnectException: Connection refused:
connect
at
org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.ja
va:261)
at
org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.ja
va:145)
at org.apache.catalina.ant.StartTask.execute(StartTask.java:71)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at org.apache.tools.ant.Main.runBuild(Main.java:673)
at org.apache.tools.ant.Main.startAnt(Main.java:188)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:320)
at sun.net.www.http.HttpClient.New(HttpClient.java:315)
at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.j
ava:521)
at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:4
98)
at
org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.ja
va:202)
... 12 more
--- Nested Exception ---
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:320)
at sun.net.www.http.HttpClient.New(HttpClient.java:315)
at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.j
ava:521)
at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:4
98)
at
org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.ja
va:202)
at
org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.ja
va:145)
at org.apache.catalina.ant.StartTask.execute(StartTask.java:71)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at org.apache.tools.ant.Main.runBuild(Main.java:673)
at org.apache.tools.ant.Main.startAnt(Main.java:188)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
Total time: 5 seconds
====================================================================

Thanks,

Brijesh
15 years ago
Dear Ranchers;

I am new to spring..To learn spring i have started of creating small application for spring MVC...I have downloaded spring-webflow-2.0.5.RELEASE.zip and copied jar files from spring-webflow-2.0.5.RELEASE\dist to lib folder of my application....But while importing org.springframework.web.servlet.ModelAndView in my code; I am getting org.springframework can not be resolved...

Like configuring plugin for tomcat in eclipse i had installed sysdeo plugin So in the same manner did i need to install and copy somthing for spring...If yes then please let me know from where i can find it by giving some link...

It will greatly appreciate if someone help me out on this topic..

Thnanks &
Best Regards;
Brijesh Shah