sudheshna Iyer

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

Recent posts by sudheshna Iyer

What are the good patterns to extract the data that is in RIS format in java?
11 years ago
Thank you for your reply.

But for getting one metadata, I have to put "Model" metadata tag. How do I know the name. That is what I posted in my code..
metadata.get("Model").equals("Canon EOS 350D DIGITAL"));
11 years ago
1. I have few questions about the extraction of metadata. So I wanted to join mailing list of Tika user group. Can you please provide the email address for it?

2. How do I extract the metadata from a file? For eg: I need author information. So for different files, author information is coming from different fields like:
Author , meta:author , citation_author

Which one should I take? Also I need to extract ~15 of predefined metadata fields like publication year , doi,.. from Metadata.
What is the best way to extract these fields from Metadata object. Metadata.names() contains elements like "citation_doi".
Should I say iterate thru metadata names and for each metadata, should I say



Is there any better way to extract the metadata?
11 years ago
Can anybody provide an example code for of lazy-initialization implementation in spring?
11 years ago
I am receiving the following error from : new Tika().parseToString(stream);

Exception in thread "main" java.lang.IncompatibleClassChangeError: class org.apache.tika.parser.asm.XHTMLClassVisitor has interface org.objectweb.asm.ClassVisitor as super class

At first I thought it is a problem with stream that is passed in. But it is very random. File that worked started erroring out with the above exception.
Please help.
I have the following "log4j.xml" in the UNIX class path. When I read the fileAppender.getFile from my java program, I am receing Null value.
I want to use "File" param for directory path and contruct file name to create a file in the directory mentioned by param "File".


I tried replacing File param with the below values and all returned Null.

My sample java program:

I appreciate your help in this regard.
I have the following "log4j.xml" in the UNIX class path. When I read the fileAppender.getFile from my java program, I am receing Null value.
I want to use "File" param for directory path and contruct file name to create a file in the directory mentioned by param "File".


I tried replacing File param with the below values and all returned Null.

<param name="File" value="\/home\/aaa"/> ==>fileAppender.getFile(): null>
<param name="File" value="/home/aaa"/> ==>fileAppender.getFile(): null>
<param name="File" value="\\/home\\/aaa"/>==>fileAppender.getFile(): null>
<param name="File" value="\/home\/aaa"/> ==> <fileAppender.getFile(): null>
<param name="File" value="'/home/aaa'"/> ===> <fileAppender.getFile(): null>
<param name="File" value="${HOME}"/> ==> <fileAppender.getFile(): null>
<param name="File" value="'file:///home/aaa'"/> ==> <fileAppender.getFile(): null>



<?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
3 <!--THIS FILES CONFIGURES LOG4J TO LOG TO CONSOLE -->
4 <log4j:configuration>
5 <appender name="ConsoleAppender" class="org.apache.log4j.ConsoleAppender">
6 <layout class="org.apache.log4j.PatternLayout">
7 <param name="ConversionPattern"
8 value="%d %-5p [%t] %C %c - %m%n"/>
9 </layout>
10 </appender>
11 <appender name="FileAppender" class="org.apache.log4j.RollingFileAppender">
12 <param name="MaxBackupIndex" value="20"/>
13 <param name="File" value="'file:///home/aaa'"/>
14 <layout class="org.apache.log4j.PatternLayout">
15 <param name="ConversionPattern" value="%d %-5p [%t] %C - %m%n"/>
16 </layout>
17 </appender>
18 <root>
19 <priority value="debug" />
20 <appender-ref ref="ConsoleAppender"/>
21 <appender-ref ref="FileAppender"/>
22 </root>
23 </log4j:configuration>

My sample java program:

private String log(String fileName, Level logLevel,String message) {
Enumeration appenders = logger.getAllAppenders();
RollingFileAppender fileAppender = null;
String strMsg = "";
String logDest = "";

while(appenders.hasMoreElements())
{
Appender currAppender = (Appender) appenders.nextElement();
if(currAppender instanceof FileAppender)
{
fileAppender = (RollingFileAppender) currAppender;
}
}
if(fileAppender != null)
{
try {
logDest = fileAppender.getFile();

System.out.println("logDest : " + logDest); ===> Receiving NULL here
File logFile = new File(fileAppender.getFile() + System.getProperty("file.separator") +
fileName + ".log");
if (!logFile.exists()) {
logFile.createNewFile();
}
fileAppender.setFile(logFile.getPath());

fileAppender.activateOptions();
} catch (IOException ioe) {
logger.error("Log file could not be created. Reason "+ioe.getMessage());
ioe.printStackTrace();
strMsg = "Error";
return strMsg;
}
}
else
{
logger.error("No File Appender found");
strMsg = "Failed";
return strMsg;
}
strMsg = "Success";
logger.log(logLevel, message);
return strMsg;
}


I appreciate your help in this regard.
alert(${aaa}); ==> works and prints whatever is the value of "aaa"

But the following is not working. Based on the variable, I need to show a confirm dialog box to proceed or not proceed.
I am seeing ${aaa} as empty in the firebug when I view source with the following code.

Any idea why " works butdoesn't work?
16 years ago
JSP
Do you mean we should do:


16 years ago
JSP
How to access the request variable in the java script?

This is what I want to do:

I want to set a boolean variable showMessage to true or false in servlet code and when the page loads

based on this variable if showMessage = true, I want to show a pop up asking user whether he wants to continue or cancel.

I can I access request variable "showMessage" in the Javascript onload event?
16 years ago
JSP
I have a string like "aaa
bbb
ccc". I want to print that as :
aaa
bbb
ccc
on to the web page.
When I use the following code. I see it get printed as "aaa
bbb " and when I view the source,
I see it as "aaa</br>bbb". How can print them with breaks.

Code:
16 years ago
JSP
I have set the log level to ERROR. But I don't see even runtime exceptions logged in my log.
log4j.logger.org.springframework=ERROR ===> No exceptions seen.

But I change log level to "WARN" as in :
log4j.logger.org.springframework=WARN

I see the following message in my log:
..
2009-02-23 01:58:55,005 DEBUG [org.springframework.web.servlet.DispatcherServlet] - Handler execution resulted in exception - forwarding to resolved error view: ModelAndView: reference to view with name 'err'; model is {exception=java.lang.NullPointerException: ..}

....
My question is how to set up Spring to log exceptions with level ERROR instead of DEBUG. This is because, in
production we want to raise level to only ERROR and so DEBUG messages will not be printed out.
Can multiple conditions be checked using JSTL?

For eg: I want to enable submit button only if condition1, condition 2 , ... are met where condition1,2..
are expressions.

Can any body provide me the syntax?
16 years ago
JSP
I want to handle 404 error and for all other error codes, I want to have a default error page.

I am using spring.

<error-page>
<error-code>404</error-code>
<location>/exception/404.htm</location>
</error-page>
<error-page>
<error-code>*</error-code> ===> This syntax is not correct. Is there any way to define this?
<location>/exception</location>
</error-page>
16 years ago
JSP
Will the session.removeAttribute("aa") throw exeption if there is no attribute set in session with "aa"?
16 years ago
JSP