Bala Tilak

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

Recent posts by Bala Tilak

Hi All,

I have a web application build using Struts2. For the website I am not using any extension ( .HTML or .do ) for pages. Its just mydaoman/pageName

Now I have usecase where user can download certain data as .pdf or .txt etc. I want to have a URL for something like mydomain/download/data.pdf and mydomain/download/data.txt etc

How can map .pdf in Struts2 ? I tried but its giving 404 error..

Regards,
Bala.
1 month ago
I have a web application which is running fine in embedded tomcat in eclipse with below struts tld declaration in JSP

<!doctype html>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html lang="en" dir="ltr">
<head>
.....

I had the struts2-core-2.5.26 jar in WEB-INF/lib and added it to the build path in Eclipse..

Now I uploaded the war to server VM, I just created the war file and copied it to tomcat WebApps root as ROOT. the pages which are not using struts tags are working fine.. but when I access the jsp pages which are using struts tags getting tld not find error..

6 months ago
Thank you. So my question is for eager fetching...Hibernate running multiple queries...Like three queries for each game loading...One for game and one for days and another for bonus info. It's taking time. Is there a way we can load all at once (including sub entities) using joins ??
Hi Tim Holloway,

Thanks for the reply. Yes its a big legacy code.. but I think EntityManager is just a wrapper around session if I am not wrong.

And I prefer XML to keep my java classes real POJOs without any annotations.

So using XML , is there any possibility that I can fetch the one to many in one query, I can't go with lazy load as I need these values to be in memory...
Hi All, hope you are doing good.

I have an application where a Game is Class which contains some properties along with a set called daysPlayed; and a list called bonusInfo..  which are from different tables..

Here is the piece of code..




and here is the snippet of XML for mapping..




When I load all the games using...



For bonus and days off Hibernate running multiple queries like two queries per Game .. Can't I load all the data at once.. like using Joins?


Regards,
Bala.
Yes. I have setter and getter for FileUpload. I restarted the Tomcat and Apache and it's started working now. Not sure how it was fixed.

Thanks a lot for your time and thought Tim.
7 months ago
Sorry for the confusion I created.

The file upload working fine with the Tomcat server. I am getting the fileUpload object if I tested it on my local system right localhost:8080/mywebapp/uploadfile

or Even its successful If I directly access the Tomcat via 8080 on server like https://myipaddress:8080/mywebapp/uploadfile.

But Its not working if I access the application via Apache 4 , that is is Apache 4 --> Tomcat 9 --> Struts. Means when I access the application like https://myipaddress:80/uploadfile the fileUpload is null.


7 months ago
Thanks for the reply Tim. Yes I am logging.

I mean the File object is null when I access the application through Apache. All the other request parameters are ok.. only the File object is null.

7 months ago
Hi,

I have a web appliction running in Tomcat (using Struts2). The Tomcat is running behind the Apache server.

I have a  use case where I have to upload a file. The functionality is working fine if I access the application directly on Tomcat (IP address:8080). But when I access the application through Apache, the uploaded file is not available to tomcat.

Not sure where I have to fix this.


Thanks in Advance.
Bala.
7 months ago
Thanks a lot for the reply @Tim Moores. It really helped me to move further..

I am able to build sample applications using both roller and jforum

Jforum suites my requirements for the Forum application and stated integrating with my existing Struts2 application.

As far as, Roller is concerned it's a very huge multi-user, multi-blog application which is heavyweight for my need. I am just looking for a single blog application. Any other simple framework for Blogging application?


Thanks,
Bala.
Hi All,

I have a simple Web application that is implemented using Struts2, Hibernate, and MYSQL.

The current application's features are just
       - Retrieve the data from the Data provider (let's say the end of the day stock price) and store it in DB,
       - Present the data to visitors
      -  Also maintaining sessions of User's who logged in to access advanced analytics.

Now I am looking to upgrade the Application with the below features. Along with the above features...
         - A Blog ( is there any framework available in Java to implement Blog ?)
         - A forum where users can start a new thread and discuss on just like our CodeRanch ( Again is there any framework in Java that can integrate with Current Struts2)
         - Want to implement server-side Cache ( just like QuickCashe in PHP) where I can use the parsed HTML unless there is an updated Record to avoid parsing of JSP every time. This to reduce the page load time compared to a competitor website which was implemented in PHP.

Please suggest to me if there are frameworks available that can integrate with current Struts 2.0? Or Should I move to PHP ( I have to learn ..:-( ) to get frameworks for the above features..

Thanks in advance.  Stay Home Stay Safe.
Regards,
Bala.
Hi All,

I have a simple Web application which is implemented using Struts2, Hibernate and MYSQL.

The current application is features are just
        - Retrieve the data from Data provider ( lets say  end of the day stock price) and store it in DB,
        - Present the data to visitors based
       -  Also maintaining sessions of User's who logged in to access Advanced anlytics.

Now I am looking to upgrade the Application with below features. Along with above fetaures...
          - A Blog ( is there any frame work available in Java to implement Blog ?)
          - A forum where users can start a new thread and discuss on just like our CodeRanch ( Again is there any framework in Java that can integrate with Current Struts2)
          - Want to implement server side Cache ( just like QuickCashe in PHP) where I can use the parsed HTML unless there is an updated Records to avoid parsing of JSP every time. This to reduce the page load time compare to a competitor website which was implemented in PHP.

Please suggest me if there are frame works available if I migrate to Spring based application ? Or Should I move to PHP ( I have to learn ..:-( ) to get frameworks for above features..

Thanks in advance..  Stay Home Stay Safe..
Regards,
Bala.
1 year ago
Thanks for the reply. Yes , as per my research on Internet also , I think, caching frequently accessed data (which dont change often ) from DB is a better choice. So we can avoid DB access for this data.

Now the question is , lets say I have a set of records, the lottery results of a state which change once in a day. I cached these results in Java (as there are 1000s of page requests for the same results on my website.). Is there any Pattern/algorithm to manage this cached data to automatically refresh when the corresponding records updated in DB ?. I am maintaining last updated column in DB for each of this lottery entry. Either programatically or using existing Cache framework in Java.


Regards,
Bala.
1 year ago
Hi All,

I have a java web application. My application uses Struts2. My application generates the results of games (each state page have around 10 games and the results are published twice daily for 7 games and two are weekly).

Now I dont want to generate the same html (from JSP everytime) instead I want to Cache the generated HTML page (like PHP Caching) and only generate the new page when ever there is a change in the states data..

Is there any tool like QuickCache for PHP available for Java ?

Or Do I need to program it manually, If yes, can you suggest me the best method to implement this.

Thanks in advance,
Bala.
1 year ago

${pageContext.request.contextPath} gives the webApp context. So this solved the issue for both Development environment as well as production. Thank you.

Example:

1 year ago