Monday, September 24, 2007

Sysdeo Tomcat PlugIn

首先,讲讲在Eclipse中如何使用Tomcat插件.安装好Tomcat插件后,启动Eclipse.如果已成功安装了Tomcat插件后,打开Window->Preferences,在弹出的窗口点击Tomcat,进行Tomcat的相关置:

我使用的是Tomcat5 ,插件的版本与Eclipse的版本是否匹配.在开发时,一定要注意 Eclipse的版本与对应的插件版本是否支持。否则造成意外无法启动。我在开发中有一次用Eclipse3.1使Tomcat3插件,出现很多意想不到 的原因,也找不到原因。最后更换为Tomcat3.1问题解决。可见插件的版本是否被Eclipse支持十重要要。

1.tomcat version (选择相应的Tomcat版本)

2.tomcat home (通过Browse选择在本地安装了的Tomcat的路径)

3.Context declaration Mode(选择Context声明的类型,1.如果选择server.xml,则新建Tomcat工程后,会自动在Server.xml文件中添加 Context属性.2.如果选择Context files,则会单独新建一个xml文件,这个文件中只有Context属性,并且自动以工程的名字命名这个文件)

1.Server.xml 将Context属性加入到 %TomcatHome%\conf\server.xml文件中
2.Context files 单独以工程名字建立一个XML文件,project.xml放置在%TomcatHome%\conf\\Catalina\localhost目录下文件只有
Context属性.

3.部署Web应用
1.拷贝war文件或Web应用文件夹至%Tomcat_Home%/server/webapps/目录下
2.为Web服务建立一个只包括Context内容的XML文件放置在%Tomcat_Home%/server/webapps/目录下,这时Web应用可以放置在硬盘的任何地方


4.Tomcat限制特定主机访问

allow="127.0.0.1"
deny="" />

5.Eclipse中新建一个Tomcat工程,会自动根据你在Eclipse配置Tomcat的属性

1,在%Tomcat_Home%/conf/server.xml中增加属性%

或者

2.Tomcat_Home%/conf/Catalina/localhost目录下新建一个以工程名字的XMl文件且其中只有属性。

若在Eclipse中删除了工程,再次启动Tomcat时,有时候会报错说找不到工程文件.原因可 能是虽然已经删除了工程,但是却有可能没有在Tomcat配置文件删除.比如:Tomcat_Home% /conf/Catalina/localhost目录下的文件没有被删除.删除即可.

Friday, September 7, 2007

“Don’t Waste Time” with Graphical Ajax Solutions

http://ajaxian.com/archives/dont-waste-time-with-graphical-ajax-solutions#comment-251827

ZDNet’s Ryan Stewart argues against performing interactive graphics with Ajax (i.e. standard web technologies). The article relates to my post on different techniques for graphics with Ajax (covered on Ajaxian).

Michael responds that the main argument against Flash is the user base, then goes on to list the plusses and minuses of "richer plugins".

You simply should not be trying to create a rich, graphical experience in Ajax. The options (SVG, Canvas, VML, ect) are buggy, supported in different ways depending on the browser, and, for the most part, are a poor experience for both users and developers.

The kind of rich interactivity that Flash and Windows Presentation Foundation provide are going to be leaps and bounds ahead of what any browser technology can do, and that's why they will succeed. The web becomes richer every day. Video and Music are taking the web by storm, and with the surge in broadband adoption, people are making these things part of their every day web experience. Ajax applications can't take advantage of them in the way the Flash or WPF can.

Flash (more generally, Richer Plugins) was actualy one of the graphics techniques mentioned in the original article. It’s all about trade-offs. I’ve actually argued myself that Ajax developers ought to take Flash more seriously, as it’s an excellent complement to Ajax. Flash sometimes makes a nice sweet spot - with graphics and multimedia closer to that of the desktop than standard DHTML/Ajax, but still living in a web platform that’s often more convenient than the desktop. The two monster apps of the past 12-18 months, YouTube and MySpace, demonstrate the power of Flash and multimedia on the web.

The benefits of Flash over Ajax are self-evident and undeniable, but Flash comes with its own set of problems too - not every user has Flash installed, not every user has the latest version, not every network allows Flash applications to run, not every developer and company wants to commit to proprietary technology when viable alternatives are available. Ajax apps tend to be easier to degrade gracefully as well; Flash is more all-or-none.

What if I want to introduce a histogram to an Ajax enterprise app? I’ll happily use a DOM/CSS library like CSS Graphs. Or if I’m writing a Firefox extension, I might use a data: resource to create a whimpy graphic since I no longer care about portability or even extravagant display. Maybe I want a 16×16 heatmap next to each search result - I’ll draw it with a Canvas and keep all the search results in standard HTML. And so on. See? Competent developers don’t engage in dogmatic battles, because they know software is all about trade-offs. Many times, Flash wins. Many times, it loses.

Last word goes to Ryan:

Don’t waste time trying to build the next generation of the web with graphical Ajax solutions … you already have a solution, and it’s getting more robust by the day. As your web applications start to require a more rich environment, embrace Rich Internet Applications - you’ll be better off.

Thursday, September 6, 2007

a SVG whiteboard example from Mark Finkle

http://starkravingfinkle.org/blog/2006/04/richdraw-simple-vmlsvg-editor/

RichDraw works in IE 6+, Firefox 1.5+ and Opera 9, using VML or SVG as the underlying renderer. Opera 9 has a small issue with the way I adjust/offset the mouse coordinates, but I’ll look into that. Currently the component supports:

  • Creating basic shapes (rectangle, rounded rectangle and ellipse) and lines.
  • Selecting shapes.
  • Deleting selected shapes.
  • Dragging shapes with mouse.
  • Setting fill color.
  • Setting line color and width.
  • Retrieving the markup.

I don’t know if there are any real uses for RichDraw in it’s current state. There is a lot that could be done to enhance RichDraw and make it more usable. Probably the most important feature would be loading markup back into the editor. On the surface, that’s easy enough to add. However, there could be situations where the markup is saved from IE (VML) and loaded back into Firefox (SVG). This would not work. I am planning on converting the VML to SVG when retrieving and converting it back when loading. That way RichDraw always appears to be using SVG. I will build from my IESVG code to handle the conversions.

Other enhancements include:

  • Resizing selected shapes.
  • Ordering (Bring to Front, Send to Back).
  • Scrollable workarea.
  • Inserting text.
  • Inserting images.

Required files: richdraw.js, svgrenderer.js, vmlrenderer.js

Demo file: richdraw_demo.htm

http://cristian.nexcess.net/ajax/whiteboard/