Java中的DataGrid Struts Web应用程序 [英] DataGrid In Java Struts Web Application

查看:103
本文介绍了Java中的DataGrid Struts Web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在浏览网页之后,我已经从下面的问题编辑了我的问题,现在是什么。
好​​的,我似乎明白,我现在不需要所有的excel的能力。我想我有一个数据网格来显示数据。基本上我在Struts 2工作,我看到我的jsp页面有一个excel的感觉,因此看起来甚至一个datagrid是足够的。我发现了这个技术



我不知道我是否必须继续使用它。任何其他建议,替代方案欢迎






旧版本的问题
我有一个java Web应用程序我现在可以在Windows上运行,我可能会在Linux服务器中托管它。



我的应用程序允许人们上传数据,我想显示他们上传的数据excel文件并将其呈现在我的网页的一部分。



我该怎么做?

解决方案

基本上,您将需要阅读excel文件,获取某些类型的Java对象中的数据,然后将其作为具有表等的普通HTML页面显示给用户。
如果要以这样的方式显示excel文件,您的用户也可以编辑这些文件,那么您需要查看javascript / ajax以根据需要制作一个UI。



在Java中阅读上传的excel文件的一个简单而开放的方式是通过Apache POI。它能够读取.xls文件以及较新的OOXML .xlsx文件。



http://poi.apache.org/spreadsheet/



他们有非常有用的例子,可以让你开始10分钟。



http ://poi.apache.org/spreadsheet/quick-guide.html



如果您可以允许数据转到另一个网站,那么您可以使用ZOHO。他们的在线Excel编辑是相当不错的,你不需要做任何事情。


After scouring the web I have edited my question from the one below to what it is now. Ok I seem to understand that I don't need all the capabilities of excel right now. I think i am satisfied having a data grid to display data. Basically i am working on Struts 2 and I wat my jsp page to have an excel like feel and hence looks like even a datagrid is sufficient. I came across This Technology

I am not sure whether I must go ahead and use it. Any other suggestions, alternatives are welcome


The older version of the question "I have a java web application running on windows currently. I may host it in future in a Linux Server.

My application allows people to upload data. I want to display the data they have uploaded in an excel file and render it in a portion of my webpage.

How do I go about this ?"

解决方案

Basically you would need to read the excel files, get the data in some kind of java objects, and then show it back to user as a normal HTML page with tables etc.. If you want to show the excel files in such a way that your users are also able to edit these then you need to look into javascript / ajax to make a UI as per your needs.

An easy and open source way of reading the uploaded excel files in java is via Apache POI. It is capable of reading .xls files as well as the newer OOXML .xlsx files.

http://poi.apache.org/spreadsheet/

They have very helpful examples which can get you started within 10 minutes..

http://poi.apache.org/spreadsheet/quick-guide.html

If you can allow data to go to another site, then you can use ZOHO. Their online Excel Editing is reasonably good and you don't really have to do anything much.

这篇关于Java中的DataGrid Struts Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆