fex-team / fis3-jello Goto Github PK
View Code? Open in Web Editor NEW基于 fis3 针对 jsp/velocity 模板的前端工程解决方案
License: BSD 3-Clause "New" or "Revised" License
基于 fis3 针对 jsp/velocity 模板的前端工程解决方案
License: BSD 3-Clause "New" or "Revised" License
请问如何用IDE(例如IDEA)使用IDE中的web server 调试FIS工程?
我有两个工程模块,namespace分别是common和home,其余fis配置均与脚手架一致。
我在home模块的某个js(a.js)中require了common模块的某个js(b.js)。
// a.js:
var b = require('common:widget/b.js');
执行fis3 release之后,js文件的moduleId都是不带.js后缀的。
我看了看:
// release后的a.js
define('home:widget/a', ['require', 'exports', 'module', 'common:widget/b.js'], function...{
var b = require('common:widget/b.js');
}
结果就是js报错,请求不到common:widget/b.js文件,我手动把release之后多余的两个.js删掉就运行正常了
# define($vmRightPageContent)
vm中使用了 ’define‘定义一个变量,但是fis3 server启动后访问报错
org.apache.velocity.exception.VelocityException: parameter missing: block name at /page/dashboard.vm[line 11, column 1]
定义变量
#set($brandConfig={
"brandName":"xxx",
"logoUrl":"logo_2.png",
"langSelectP":"fr"
})
报错
org.apache.velocity.exception.ParseErrorException: Encountered "object" at /common/brandConfig.vm[line 5, column 30]
Was expecting one of:
"[" ...
"]" ...
"{" ...
...
<STRING_LITERAL> ...
"true" ...
"false" ...
<INTEGER_LITERAL> ...
<FLOATING_POINT_LITERAL> ...
...
"{" ...
...
...
"{" ...
<INTEGER_LITERAL> ...
这些在java后台环境都是可用的,是那里没有配置对么?
require.config({
paths: {
"components/bootstrap/affix": "/static/components/bootstrap/affix",
"components/bootstrap/alert": "/static/components/bootstrap/alert",
"components/bootstrap/bootstrap": "/static/components/bootstrap/bootstrap",
"components/bootstrap/button": "/static/components/bootstrap/button",
"components/bootstrap/carousel": "/static/components/bootstrap/carousel",
"components/bootstrap/collapse": "/static/components/bootstrap/collapse",
"components/bootstrap/dropdown": "/static/components/bootstrap/dropdown",
"components/bootstrap/modal": "/static/components/bootstrap/modal",
"components/bootstrap/popover": "/static/components/bootstrap/popover",
"components/bootstrap/scrollspy": "/static/components/bootstrap/scrollspy",
"components/bootstrap/tab": "/static/components/bootstrap/tab",
"components/bootstrap/tooltip": "/static/components/bootstrap/tooltip",
"components/bootstrap/transition": "/static/components/bootstrap/transition",
"components/jquery/jquery": "/static/components/jquery/jquery"
}
})
我现在对namespace的概念比较模糊,用了一下namespace,主要是把项目的公共部分提出来做为一个子项目,设置namespace为common,首页做为一个子项目设为home,但是用的时候发现一个问题,我把公共部分的样式、js放到namespace为common的子项目中,home想用的时候就直接引用,一些js可以,但是引用scss的一些mixins这种需要编译的文件就不行了。能否告知namespace是如何应用于项目中的,又是如何产生的。
fis3 server start
[INFO] Currently running fis3 (C:\Users\libiqi\AppData\Roaming\npm\node_modules\fis3)
[INFO] Shutdown with pid [8076]
checking java support : v1.7.0
starting fis-server ..... fail
ʮһ�� 13, 2015 1:02:13 ���� org.apache.coyote.AbstractProtocol init
��Ϣ: Initializing ProtocolHandler ["http-bio-8080"]
ʮһ�� 13, 2015 1:02:14 ���� org.apache.catalina.core.StandardService startInternal
��Ϣ: Starting service Tomcat
ʮһ�� 13, 2015 1:02:14 ���� org.apache.catalina.core.StandardEngine startInternal
��Ϣ: Starting Servlet Engine: Apache Tomcat/7.0.50
ʮһ�� 13, 2015 1:02:14 ���� org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
��Ϣ: No global web.xml found
[ERROR] timeout
需求是这样的
1、用的
`#script()
require("./hotCar")
引用了一个js文件,但我想在页面渲染出来的时候给这个script标签上加一个属性,如data="type"
2、hotCar.js在生产环境会被合并到pkb/common.js里,那如果给common.js也加上data="type"属性呢
求解
fis3 release -w 不能狗更新 & mock 文件夹被打包到了 static目录下,为什么??
fis3-jello自定标签的实现类放在什么地方?<%@ taglib uri="/fis" prefix="fis"%>这一行。联调时把本地代码编译发布到rd开发环境下。rd的开发环境并没有自定义标签的实现类,请问这块应该怎么不熟,把我本地的WEB-INF下的lib复制一份到rd环境中?
gem install compass
fis3 release
Error: Can't find compass/css3
in /static/scss/_modal.scss
fis3 -v
[INFO] Currently running fis3 (/home/saas/node/0.12.7/lib/node_modules/fis3)
v3.2.1
cnpm install -g fis3-jello
\
[email protected] install /home/saas/node/0.12.7/lib/node_modules/fis3-jello/node_modules/fis-parser-sass/node_modules/fis-sass
node build.js
Downloading http://fisstatic.duapp.com/addons/fis-sass/3.1.0/linux-x64/0.12.0/binding.node ...
Received 513K...
Received 1026K...
Received 1539K...
Received 1753K total.
Test failed!
child_process: customFds option is deprecated, use stdio instead.
make: Entering directory /home/saas/node/0.12.7/lib/node_modules/fis3-jello/node_modules/fis-parser-sass/node_modules/fis-sass/build' CXX(target) Release/obj.target/binding/src/binding.o ../src/binding.cpp: In function ‘Sass_Import** sass_importer2(const char*, const char*, void*)’: ../src/binding.cpp:27: 警告:实参为 NULL,需要非 NULL 值(实参 1) ../src/binding.cpp:28: 警告:实参为 NULL,需要非 NULL 值(实参 1) ../src/binding.cpp: In function ‘void GetStats(v8::Handle<v8::Object>, Sass_Context*)’: ../src/binding.cpp:95: 错误:‘nullptr’在此作用域中尚未声明 make: *** [Release/obj.target/binding/src/binding.o] 错误 1 make: Leaving directory
/home/saas/node/0.12.7/lib/node_modules/fis3-jello/node_modules/fis-parser-sass/node_modules/fis-sass/build'
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/saas/node/0.12.7/lib/node_modules/cnpm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 2.6.32-573.3.1.el6.x86_64
gyp ERR! command "node" "/home/saas/node/0.12.7/lib/node_modules/cnpm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/saas/node/0.12.7/lib/node_modules/fis3-jello/node_modules/fis-parser-sass/node_modules/fis-sass
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
Build failed
npm ERR! Linux 2.6.32-573.3.1.el6.x86_64
npm ERR! argv "node" "/home/saas/node/0.12.7/lib/node_modules/cnpm/node_modules/.bin/npm" "--userconfig=/home/saas/.cnpmrc" "--disturl=https://npm.taobao.org/mirrors/node" "--cache=/home/saas/.cnpm" "--registry=https://registry.npm.taobao.org" "--node-gyp=/home/saas/node/0.12.7/lib/node_modules/cnpm/node_modules/node-gyp/bin/node-gyp.js" "install" "-g" "fis3-jello"
npm ERR! node v0.12.7
npm ERR! npm v2.14.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node build.js'.
npm ERR! This is most likely a problem with the fis-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls fis-sass
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/saas/node/0.12.7/npm-debug.log
我需要遍历map的所有key,官网是这么写的http://velocity.apache.org/engine/devel/user-guide.html#foreach-loop
但是jello里貌似不支持,有办法么?
HTTP Status 500 - Request processing failed; nested exception is org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'page/index/page/include/base.vm'
type Exception report
message Request processing failed; nested exception is org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'page/index/page/include/base.vm'
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'page/index/page/include/base.vm'
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:965)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)
javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'page/index/page/include/base.vm'
org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:474)
org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:352)
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1533)
org.apache.velocity.runtime.directive.Parse.render(Parse.java:197)
com.baidu.fis.velocity.directive.AbstractInclude.render(AbstractInclude.java:237)
com.baidu.fis.velocity.directive.Extends.doRender(Extends.java:100)
com.baidu.fis.velocity.directive.Extends.render(Extends.java:47)
org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
org.apache.velocity.Template.merge(Template.java:356)
org.apache.velocity.Template.merge(Template.java:260)
org.springframework.web.servlet.view.velocity.VelocityView.mergeTemplate(VelocityView.java:517)
org.springframework.web.servlet.view.velocity.VelocityView.doRender(VelocityView.java:462)
org.springframework.web.servlet.view.velocity.VelocityView.renderMergedTemplateModel(VelocityView.java:291)
org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:167)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:264)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1201)
org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:986)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:933)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)
javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.59 logs.
Apache Tomcat/7.0.59
产出的路径 跟fis2 没区别。
fis2 的时候 读取地址'page/include/base.vm' fis3 变成 'page/index/page/include/base.vm' 增加了当前vm所在路径的地址
将fis3 release 的内容到tomcat 但是无法看到页面,空白。如何将输出的项目跑在tomcat下?
昨天看到大神提交代码了,激动的下载下来用。现在有个问题就是
fis3 server stop 没有效果
C:\jello>fis3 server stop
[INFO] Currently running fis3 (C:\work\nodejs\npm-global\node_modules\fis3\)
[WARNI] The server is not runing.
C:\Users\58\AppData\Roaming\npm\node_modules\fis3\lib\log.js:201
throw err
^
Error: fis-server fails to start at port [8080], error: com.baidu.
pListener
at Object.exports.error (C:\Users\58\AppData\Roaming\npm\node_
ib\log.js:192:11)
at Socket.<anonymous> (C:\Users\58\AppData\Roaming\npm\node_mo
lo\node_modules\fis3-server-jello\vendor\server.js:123:15)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at Pipe.onread (net.js:538:20)
另:关于jello方面使用的案例有可供参考的例子么有捏。
1.确定在当前项目目录使用fis3 server start启动服务,页面显示
/
static
test
WEB-INF
发现jello有默认设置fis.set('server.type', 'jello');
2.使用fis3 server start --type jello 启动
页面正常打开,但是页面中所有的ajax转发仍然404,server.conf不生效
上述配置在mac中都是正常的
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:116:14)
gyp ERR! stack at D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:71:11
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "D:\Program Files\nodejs\node.exe" "D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd F:\study\fis3-jello\jello-demo\node_modules\fis3-jello\node_modules\fis-parser-sass\node_modules\fis-sass
gyp ERR! node -v v4.1.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
Build failed
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\Program Files\nodejs\node.exe" "D:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v4.1.1
npm ERR! npm v2.14.4
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node build.js'.
npm ERR! This is most likely a problem with the fis-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls fis-sass
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! F:\study\fis3-jello\jello-demo\npm-debug.log
Installing components...
[ERROR] unable to load plugin [fis3-jello] or [fis-jello]
可以帮我看看是啥原因么?
widget下同名的scss文件没有加载,fis2-jello没有这个问题,可以直接运行jello-demo来验证这个问题。,访问/be/spring,请求了sidebarmenus.js,但是没有加载sidebarmenus.css。
期望得到浮点型,但结果在编译之后产出的文件中变成了
求解决。。谢谢。。
Settings.DEFAULT_PATH不能自定义,当然幸好不是final的
顺便吐槽一下日志都是sysout的.......以及各种写死的WEB-INF
"cfq:widget/login/login.js": {
"uri": "/static/cfq/widget/login/login.js",
"type": "js",
"extras": {
"moduleId": "cfq:widget/login/login"
},
"deps": [
"common:components\\zepto-1.1.4\\zepto.js",
"common:static\\arrow\\base\\base.js",
"common:static\\arrow\\validate\\validate.js",
"common:static\\arrow\\form\\form.js",
"common:static\\arrow\\info\\info.js"
]
}
比如我同一个项目里面有下面这两个异步请求
GET /A/B/C
POST /A/B/C
这两个请求我是需要模拟不同的返回数据的,这个如何做到呢?
目前我们在server.conf里面只能配一个
rewrite ^/A/B/C$ /page/A/B/C
这个是没办法区分httpMethod的。
如题,用fis3 server open看,不生成WEB-INF/conf/map.json,需要特殊配置吗
如题,大概就是首屏时候使用服务器渲染,刷新使用ajax请求。
scrat的pagelet
https://github.com/scrat-team/pagelet.js
不知道jello类似的方案有没有大概的思路呢?
也没有声明使用的其他组件的版本
比如
<!-- [if ie8]> <body class="ie8"><![endif]-->
mac os x yosemite, 版本10.10.5, java8环境.
fis3 server release没有问题,文件都编译好放入./fis3-tmp目录.
但是 server start后,不显示首页,直接显示目录,系统没有报错,请问是什么情况?有谁知道如何解决么?
如
#if($banners and $banners.size() > 0)##
[ERROR] preprocessor.extlang: Parse error on line 9: ..."> #if($!banners and $!banners.size() ----------------------^ Expecting 'CLOSE_PARENTHESIS', '||', '&&', '+', '-', '*', '/', '%', '>', '<', '==', '>=', '<=', '!=', got 'ID' [/page/index.vm]
文档里提到了 fis3-jello 引入了模版,可以将 css 和 js 放在合适的位置,同时可以合并链接。这些功能都很好理解,但是有一些疑问,希望有朋友可以帮忙解释一下,谢谢。
<fis:script>
替换成 <script>
。<fis:widget>
与 <c:import>
有什么区别?jello 可以把github.com/ultraq/thymeleaf-js,这个thymeleaf,在jello,加多这一种方案解析thymeleaf
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.