playframework-1.x

Getting this “org.xhtmlrenderer.render.BlockBox cannot be cast to org.xhtmlrenderer.newtable.TableBox” while trying to render a pdf

六眼飞鱼酱① 提交于 2019-12-23 03:12:58
问题 I am getting this error while I am trying to render a pdf. I am using Nicolas Leroux's PDF module for the play framework. This is the entire stackstrace: Pastebin. Googling only reveals 4 results. They suggest removing any float properties, and position attributes, which I have removed, jsut to give it a try. I am still facing this problem. Has anyone been able to solve the issue? EDIT: This is the html that renders the pdf: #{extends 'main.html' /} #{set title:'Salary Details' /} <html>

Cannot Run Play Framework Project on Netbeans 7.2 IDE

旧城冷巷雨未停 提交于 2019-12-23 01:37:18
问题 I have a working Play Framework project. I'm using Play Framework version number 1.2.5 and Java version 1.7 update 5 . I have been used play netbeansify command on terminal and successfully load the project. But then, when I tried to run the project its failed to RUN and Netbeans console show error like this: C:\play-1.2.5\id doesn't exist Listening for transport dt_socket at address: 8099 Error: Could not find or load main class ${jvm.memory} Java Result: 1 BUILD SUCCESSFUL (total time: 3

How to extend the playframework?

*爱你&永不变心* 提交于 2019-12-17 15:25:15
问题 Sometime it's necessary to extends a framework. Sometimes it's necessary to hook into the request/response lifecycle, for example for a parameter binding or to write a security module. How could this be done in the playframework 1.x? 回答1: There are two ways to extend play 1.x. First you can write your own module. This is described in detail here. This is useful if you want provide a library such as iText or provide a special authentication mechanism. The second way is to write a PlayPlugin .

How to avoid creating schema with PlayFramework

无人久伴 提交于 2019-12-14 02:51:17
问题 I have an existing database schema managed by another webapp. The playframework I am creating needs to read/write to this existing schema but it's deleting and recreating the tables when play starts up. How do I turn off the table creation? update: play 1.2.5 mysql update2: @Entity(name="mytable_name") public class Sample extends Model { public Integer some_value; public String fullname; } inside a Controller method... List<Sample> list = Sample.findAll(); The table exists with data, I run

Uploading a file in Java Play 1.2.3 then storing file as byte array causes PersistenceException

我怕爱的太早我们不能终老 提交于 2019-12-13 06:43:40
问题 I'm creating a POST service that allows an admin-user to upload images to a Play! application, and while I'm testing it I am using the inbuilt H2 filesystem database. According to https://gist.github.com/1256286#file-picture-java-L3 a good way to store these images in Play! is as a byte array, which is then rendered using Controller#renderBinary(...) . The Campaign object in this function stores all the data about a campaign and has a list of Banner objects, each of which is basically an

How Playframework 1.x static method works in a thread safe way

妖精的绣舞 提交于 2019-12-11 11:38:47
问题 Might be a silly question, but I'm noob learning Play framework 1.2.5. I've noticed that the controller actions are all static methods and I assume each request will be processed in a separate thread. If that's the case, how Play framework ensures these static controller methods are thread safe? I think, as long as we are not sharing anything between controller methods then we are good (?), please correct me if I'm wrong. Thanks in advance. 回答1: Yes we're quite good. As you know HTTP is

How do I override CRUD tags in Play! Framework 1.2.4

自作多情 提交于 2019-12-11 09:56:32
问题 I've got a Model with a Many-To-Many relationship and have applied the CRUD module to it, so I get a nice multi-select box rendered on the admin screen, but it's only 4 lines high. I want to specify at least 20 lines but because CRUD is all auto-generated by reflecting the object (I guess...), even overriding the template doesn't allow for this. The code I need to override is in views.tags.crud/relationField.html - I just want to add a "size" value like this :- <select id="${field.id}" name="

Job-Scheduling in Play! Framework

筅森魡賤 提交于 2019-12-11 08:23:57
问题 I am currently into the development of a play-powered (v. 1.2.4) application where users can perform certain tasks and gain rewards for doing so. These tasks require some energy, which will be refilled over time. The basic setting is as follows: public class User extends Model { public Long energy; public Long maxenergy; public Long cooldown = Long.valueOf(300); } public class Task extends Controller { public static void perform(Long id) { User user = User.findById(id).first(); // do some

Play! framework: can I reschedule the job?

我只是一个虾纸丫 提交于 2019-12-11 07:41:22
问题 I'm using Play! framwork of version 1.2.4 In my application, I have implemented a number of scheduled jobs (descendants of play.jobs.Job ). Question Can I change the schedule of these jobs at runtime? My own findings At first glance, the job scheduling in Play! is done via play.jobs.JobsPlugin , which in turn uses JDK's java.util.concurrent.ScheduledThreadPoolExecutor instance which is publicly exposed. So far I came up with following approach: when it's the moment to change schedule, I

Configuring Play 1.x/JPA to generate entity IDs sequentially?

大城市里の小女人 提交于 2019-12-11 02:45:46
问题 What's the best way to force Play/JPA to make entity IDs sequential? (They are not) One idea is to copy play.db.jpa.Model into my own ModelBase class and change the generation strategy to GenerationType.IDENTITY (at least for mysql). Is this the best solution? Can I even do this (change my model base class) on a production website with existing data? Is this safe? 回答1: If you need a pure sequence (no gaps) for your entities, don't use the id, create a new sequence in your database and link it