ashu Suri

Greenhorn
+ Follow
since Oct 22, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by ashu Suri

Hi Mark,
Thanks for the reply. but I did not follow you completely.
How will adding this tag <security:http> in security xml solve the issue of filter chain and login.
Could you please elaborate. Thanks for your time .
regards,
Gagan Suri
9 years ago
hi,
i am tryign to migrate from spring security 2.x t0 3.x. please suggest any guide for the same.
I am getting nullpointerException in org.springframework.security.web.FilterChainProxy. filterChainMap is coming null in FilterChainProxy.getFilters()
filterchain proxy has been defined as this

<bean id="filterChainProxy" class="org.springframework.security.web.FilterChainProxy">
<security:filter-chain-map path-type="ant">
<security:filter-chain pattern="/login.jsp" filters="none"/>
<security:filter-chain pattern="/css/**" filters="none"/>
<security:filter-chain pattern="/images/**" filters="none"/>
<security:filter-chain pattern="/*.jsp*/**" filters="httpSessionContextIntegrationFilter,logoutFilter,formAuthenticationProcessingFilter,exceptionTranslationFilter,filterSecurityInterceptor,userBeanFilter"/>
<security:filter-chain pattern="/**" filters="httpSessionContextIntegrationFilter,logoutFilter,formAuthenticationProcessingFilter,exceptionTranslationFilter,filterSecurityInterceptor,userBeanFilter"/>
</security:filter-chain-map>
</bean>

Please help me .
9 years ago
Try StreamGobblers.
This should solve your problem.
Sample code :

Runtime rt = Runtime.getRuntime();

Process proc = rt.exec(cmd);
// any error message?
StreamGobbler errorGobbler = new
StreamGobbler(proc.getErrorStream(), "ERROR");

// any output?
StreamGobbler outputGobbler = new
StreamGobbler(proc.getInputStream(), "OUTPUT");

// kick them off
errorGobbler.start();
outputGobbler.start();

// any error???
int exitVal = proc.waitFor();
System.out.println("ExitValue: " + exitVal);



class StreamGobbler extends Thread
{
InputStream is;
String type;

StreamGobbler(InputStream is, String type)
{
this.is = is;
this.type = type;
}

public void run()
{
try
{
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line=null;
while ( (line = br.readLine()) != null)
System.out.println(type + ">" + line);
} catch (IOException ioe)
{
ioe.printStackTrace();
}
}
}

Try this.
Thanks,
Gagan
10 years ago
Could you paste the code here.
Convert everything into seconds, if that is not large and then calculate the percentage.
total talk time(in seconds)=hh*3600+mm*60+ss
and then calculate the percentage like this = total talk time(in hours)/ total Time

Other way is like this..convert everything into hours hh:mm:ss
Like this
total talk time(in hours)=hh+mm/60+ss/3600

and then calculate the percentage like this = total talk time(in hours)/ total Time
or whatever percentage you want to calculate.
10 years ago
Hi,
I actually want to call all the methods of all the classes using one single method in the TestFramework class.
My TestFramework class would call all the methods of the classes with given input and expected output using reflection.
And I want to generate the coverage report of this as well.
Thanks,
Gagan
11 years ago
Hi,
Thanks for your reply.
But the problem is that I want to execute the test cases from my class and also
generate the report from my class.
Thanks,
Gagan
11 years ago
Hi,
I call my Junit Test case from my Own class using TestRunner .dorun() method.
How can I call EMMA also to generate the coverage report.

like this
TestRunner runner=new TestRunner();
TestResult trs=runner.doRun(new TestSuite(TestFramework.class));

Thanks,
Gagan
11 years ago
Run this program and we get extra "Testclass" in the ouput.
Can anybody explain where is it coming from?


public class Test {

public static String text = new String();

public static void main(String args[]){

System.out.println(text.getClass());

System.out.println(text.getClass()+ " unknown " + new Test().test());
}

public String test(){
System.out.print(getClass());
return "";
}

}

Thanks,
Gagan
11 years ago
[ UD: Code removed, as it's broken. Rob's post explains why. Please, people, read and understand previous posts before posting. ]
11 years ago
Did you find solution for this problem.
If yes, please forward that to me on gagan.suri@gmail.com

Thanks,
Gagan
I want to extract text from MS Word files through Java.
I am not able to use POI properly.
Though many forums say that its easy to extract text using POI. In case anybody can help me
on this. I would be thankful.
Thanks in advance
A
12 years ago
<welcome-file> is the tag that tells the app server which file to load if the application name is given.
place your welcome file palace.jsp in this tag and it should run well
for books on jsp try advanced jsp in here
12 years ago
JSP
change the entry in web.xml.

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>upload.jsp</welcome-file>
</welcome-file-list>


and change the <welcome-file>palace.jsp</welcome-file> in web.xml.
This should solve your problem.
12 years ago
JSP
Add project C in the Build path of the project A.
Goto Build Path>configure build path>Projects Tab>Add Project
and add project C to build path of Project A.This should solve your problem
also clean the projects.
12 years ago